diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-06 15:33:35 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-06 15:33:35 +0100 |
| commit | b3aa853ec536926c4fd2739c8d39091fe48e51c9 (patch) | |
| tree | 2dc5aa73331120e90f460918516295212dec6ad9 /tests/select_for_update | |
| parent | d1a5fe07ed96794864d9aa69502ed056bb7a561b (diff) | |
Used more precise test assertions.
Diffstat (limited to 'tests/select_for_update')
| -rw-r--r-- | tests/select_for_update/tests.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/select_for_update/tests.py b/tests/select_for_update/tests.py index c5a04881c9..b9716bd797 100644 --- a/tests/select_for_update/tests.py +++ b/tests/select_for_update/tests.py @@ -81,9 +81,6 @@ class SelectForUpdateTests(TransactionTestCase): sql = tested_connection.queries[-1]['sql'] return bool(sql.find(for_update_sql) > -1) - def check_exc(self, exc): - self.assertTrue(isinstance(exc, DatabaseError)) - @skipUnlessDBFeature('has_select_for_update') def test_for_update_sql_generated(self): """ @@ -129,7 +126,7 @@ class SelectForUpdateTests(TransactionTestCase): time.sleep(1) thread.join() self.end_blocking_transaction() - self.check_exc(status[-1]) + self.assertIsInstance(status[-1], DatabaseError) # In Python 2.6 beta and some final releases, exceptions raised in __len__ # are swallowed (Python issue 1242657), so these cases return an empty @@ -261,7 +258,7 @@ class SelectForUpdateTests(TransactionTestCase): time.sleep(1) thread.join() self.end_blocking_transaction() - self.check_exc(status[-1]) + self.assertIsInstance(status[-1], DatabaseError) @skipUnlessDBFeature('has_select_for_update') def test_transaction_dirty_managed(self): |
