diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-12-21 04:58:38 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-12-21 05:02:19 +0000 |
commit | ade1b2cc7b9fc7b0fc05f70e2c15c1d1d1e56ca8 (patch) | |
tree | a831e5f16a239ca33c7920bbada5f58928a954e5 /tests/test_async.py | |
parent | f697410ab4aac2f7ac789e78efc4e5ac5dfb6f71 (diff) | |
download | psycopg2-ade1b2cc7b9fc7b0fc05f70e2c15c1d1d1e56ca8.tar.gz |
Test suite converted into a proper package.
Dropped cyclic import from modules to tests: they were only working
because a second copy of the package was found in the project dir.
Use relative import so that 2to3 can do a good conversion.
Diffstat (limited to 'tests/test_async.py')
-rwxr-xr-x | tests/test_async.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/test_async.py b/tests/test_async.py index 96d7a2c..be4a1d8 100755 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -8,12 +8,7 @@ import time import select import StringIO -import sys -if sys.version_info < (3,): - import tests -else: - import py3tests as tests - +from testconfig import dsn class PollableStub(object): """A 'pollable' wrapper allowing analysis of the `poll()` calls.""" @@ -33,8 +28,8 @@ class PollableStub(object): class AsyncTests(unittest.TestCase): def setUp(self): - self.sync_conn = psycopg2.connect(tests.dsn) - self.conn = psycopg2.connect(tests.dsn, async=True) + self.sync_conn = psycopg2.connect(dsn) + self.conn = psycopg2.connect(dsn, async=True) self.wait(self.conn) @@ -309,7 +304,7 @@ class AsyncTests(unittest.TestCase): def __init__(self, dsn, async=0): psycopg2.extensions.connection.__init__(self, dsn, async=async) - conn = psycopg2.connect(tests.dsn, connection_factory=MyConn, async=True) + conn = psycopg2.connect(dsn, connection_factory=MyConn, async=True) self.assert_(isinstance(conn, MyConn)) self.assert_(conn.async) conn.close() |