summaryrefslogtreecommitdiff
path: root/tests/test_transaction.py
diff options
context:
space:
mode:
authorJames Henstridge <james@jamesh.id.au>2008-04-20 23:12:21 +0000
committerJames Henstridge <james@jamesh.id.au>2008-04-20 23:12:21 +0000
commit2f3f4c1258ee6455b8b956c9f9d70a372b5a80f5 (patch)
tree21cecf1551cdf0b1958ebfba9e1fd5a3f008e313 /tests/test_transaction.py
parent962c5a9a5f359908311cbe0b37b5f257256c4cf5 (diff)
downloadpsycopg2-2f3f4c1258ee6455b8b956c9f9d70a372b5a80f5.tar.gz
2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>
* tests/*.py: use the DSN constructed in tests/__init__.py. * tests/__init__.py: allow setting the host, port and user for the DSN used by the tests through the environment.
Diffstat (limited to 'tests/test_transaction.py')
-rwxr-xr-xtests/test_transaction.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_transaction.py b/tests/test_transaction.py
index 5145ace..9517541 100755
--- a/tests/test_transaction.py
+++ b/tests/test_transaction.py
@@ -11,7 +11,7 @@ import tests
class TransactionTests(unittest.TestCase):
def setUp(self):
- self.conn = psycopg2.connect("dbname=%s" % tests.dbname)
+ self.conn = psycopg2.connect(tests.dsn)
self.conn.set_isolation_level(ISOLATION_LEVEL_SERIALIZABLE)
curs = self.conn.cursor()
curs.execute('''
@@ -75,7 +75,7 @@ class DeadlockSerializationTests(unittest.TestCase):
"""Test deadlock and serialization failure errors."""
def connect(self):
- conn = psycopg2.connect("dbname=%s" % tests.dbname)
+ conn = psycopg2.connect(tests.dsn)
conn.set_isolation_level(ISOLATION_LEVEL_SERIALIZABLE)
return conn
@@ -208,7 +208,7 @@ class QueryCancelationTests(unittest.TestCase):
"""Tests for query cancelation."""
def setUp(self):
- self.conn = psycopg2.connect("dbname=%s" % tests.dbname)
+ self.conn = psycopg2.connect(tests.dsn)
self.conn.set_isolation_level(ISOLATION_LEVEL_SERIALIZABLE)
def test_statement_timeout(self):