summaryrefslogtreecommitdiff
path: root/tests/test_cancel.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-12-21 04:58:38 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-12-21 05:02:19 +0000
commitade1b2cc7b9fc7b0fc05f70e2c15c1d1d1e56ca8 (patch)
treea831e5f16a239ca33c7920bbada5f58928a954e5 /tests/test_cancel.py
parentf697410ab4aac2f7ac789e78efc4e5ac5dfb6f71 (diff)
downloadpsycopg2-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_cancel.py')
-rw-r--r--tests/test_cancel.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_cancel.py b/tests/test_cancel.py
index 52383f8..8e651ff 100644
--- a/tests/test_cancel.py
+++ b/tests/test_cancel.py
@@ -2,18 +2,18 @@
import time
import threading
-from testutils import unittest, skip_if_no_pg_sleep
-import tests
import psycopg2
import psycopg2.extensions
from psycopg2 import extras
+from testconfig import dsn
+from testutils import unittest, skip_if_no_pg_sleep
class CancelTests(unittest.TestCase):
def setUp(self):
- self.conn = psycopg2.connect(tests.dsn)
+ self.conn = psycopg2.connect(dsn)
cur = self.conn.cursor()
cur.execute('''
CREATE TEMPORARY TABLE table1 (
@@ -65,7 +65,7 @@ class CancelTests(unittest.TestCase):
@skip_if_no_pg_sleep('conn')
def test_async_cancel(self):
- async_conn = psycopg2.connect(tests.dsn, async=True)
+ async_conn = psycopg2.connect(dsn, async=True)
self.assertRaises(psycopg2.OperationalError, async_conn.cancel)
extras.wait_select(async_conn)
cur = async_conn.cursor()
@@ -79,7 +79,7 @@ class CancelTests(unittest.TestCase):
self.assertEqual(cur.fetchall(), [(1, )])
def test_async_connection_cancel(self):
- async_conn = psycopg2.connect(tests.dsn, async=True)
+ async_conn = psycopg2.connect(dsn, async=True)
async_conn.close()
self.assertTrue(async_conn.closed)