diff options
| author | James Henstridge <james@jamesh.id.au> | 2008-01-19 03:32:42 +0000 |
|---|---|---|
| committer | James Henstridge <james@jamesh.id.au> | 2008-01-19 03:32:42 +0000 |
| commit | 3265dd172d259201d90666eff17b3276e798a270 (patch) | |
| tree | d6c857687994dacc807599d4dccc06594af0c4d6 /tests/test_transaction.py | |
| parent | 11b017fcbe54a0e25be34c1b960d1eba3e484fc5 (diff) | |
| download | psycopg2-3265dd172d259201d90666eff17b3276e798a270.tar.gz | |
* tests/test_connection.py (ConnectionTests): add simple tests for
the Connection and Cursor "closed" attributes.
* psycopg/cursor_type.c (psyco_curs_get_closed): add a "closed"
attribute to cursors. It will be True if either the cursor or its
associated connection are closed. This fixes bug #164.
Diffstat (limited to 'tests/test_transaction.py')
| -rwxr-xr-x | tests/test_transaction.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/test_transaction.py b/tests/test_transaction.py index bd96ce4..5145ace 100755 --- a/tests/test_transaction.py +++ b/tests/test_transaction.py @@ -3,13 +3,12 @@ import threading import unittest import psycopg2 -import psycopg2 -import tests - from psycopg2.extensions import ( ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY) +import tests + -class TransactionTestCase(unittest.TestCase): +class TransactionTests(unittest.TestCase): def setUp(self): self.conn = psycopg2.connect("dbname=%s" % tests.dbname) @@ -72,7 +71,7 @@ class TransactionTestCase(unittest.TestCase): self.assertEqual(curs.fetchone()[0], 1) -class DeadlockSerializationTestCase(unittest.TestCase): +class DeadlockSerializationTests(unittest.TestCase): """Test deadlock and serialization failure errors.""" def connect(self): @@ -223,6 +222,3 @@ class QueryCancelationTests(unittest.TestCase): def test_suite(): return unittest.TestLoader().loadTestsFromName(__name__) -if __name__ == "__main__": - unittest.main() - |
