Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Used more precise test assertions.

  • Loading branch information...
commit b3aa853ec536926c4fd2739c8d39091fe48e51c9 1 parent d1a5fe0
@aaugustin aaugustin authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 tests/select_for_update/tests.py
View
7 tests/select_for_update/tests.py
@@ -81,9 +81,6 @@ def has_for_update_sql(self, tested_connection, nowait=False):
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 @@ def test_nowait_raises_error_on_block(self):
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 @@ def raw(status):
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):
Please sign in to comment.
Something went wrong with that request. Please try again.