summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/test/testing.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2009-08-31 21:53:49 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2009-08-31 21:53:49 +0000
commit2cb92cbbd0dda5646c98ddb29592064221740753 (patch)
treee913441b1ab397c9180520f64972406493065dbd /lib/sqlalchemy/test/testing.py
parent358ab55c311a823c241a5ae87806cb2607e5e1f1 (diff)
downloadsqlalchemy-2cb92cbbd0dda5646c98ddb29592064221740753.tar.gz
- Fixed incorrect exception raise in
Weak/StrongIdentityMap.add() [ticket:1506]
Diffstat (limited to 'lib/sqlalchemy/test/testing.py')
-rw-r--r--lib/sqlalchemy/test/testing.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/test/testing.py b/lib/sqlalchemy/test/testing.py
index 3689ca0b7..9c5c87f3f 100644
--- a/lib/sqlalchemy/test/testing.py
+++ b/lib/sqlalchemy/test/testing.py
@@ -497,9 +497,12 @@ def startswith_(a, fragment, msg=None):
def assert_raises(except_cls, callable_, *args, **kw):
try:
callable_(*args, **kw)
- assert False, "Callable did not raise an exception"
+ success = False
except except_cls, e:
- pass
+ success = True
+
+ # assert outside the block so it works for AssertionError too !
+ assert success, "Callable did not raise an exception"
def assert_raises_message(except_cls, msg, callable_, *args, **kwargs):
try: