summaryrefslogtreecommitdiff
path: root/test/testlib/testing.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2007-11-01 23:13:30 +0000
committerJason Kirtland <jek@discorporate.us>2007-11-01 23:13:30 +0000
commit55c9b05cdbb46355cf6bd7385274fcdf22a49ba9 (patch)
treee9e1b06751e3e0c971186804f3735cd83a23275a /test/testlib/testing.py
parentc87295cdfdd393ebc07a84a199dacbac2025c748 (diff)
downloadsqlalchemy-55c9b05cdbb46355cf6bd7385274fcdf22a49ba9.tar.gz
Tweaks for assert_unordered_result
Diffstat (limited to 'test/testlib/testing.py')
-rw-r--r--test/testlib/testing.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/testlib/testing.py b/test/testlib/testing.py
index 60b0173d8..941ddf249 100644
--- a/test/testlib/testing.py
+++ b/test/testlib/testing.py
@@ -316,12 +316,18 @@ class AssertMixin(PersistTest):
self.fail('Unexpected type "%s", expected "%s"' % (
type(wrong).__name__, cls.__name__))
+ if len(found) != len(expected):
+ self.fail('Unexpected object count "%s", expected "%s"' % (
+ len(found), len(expected)))
+
NOVALUE = object()
def _compare_item(obj, spec):
for key, value in spec.iteritems():
if isinstance(value, tuple):
- if (not self.assert_unordered_result(
- getattr(obj, key), value[0], *value[1])):
+ try:
+ self.assert_unordered_result(
+ getattr(obj, key), value[0], *value[1])
+ except AssertionError:
return False
else:
if getattr(obj, key, NOVALUE) != value: