summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-08-22 13:55:49 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-08-22 13:55:49 -0400
commit41549de9609bce90942ca6afc75978d5254c8fd5 (patch)
tree7df8b5cf54d9049cc0808360d5e8ed3571080802
parent4c306818396c8cc98a16a14c5ed3361cf6ff373a (diff)
downloadsqlalchemy-41549de9609bce90942ca6afc75978d5254c8fd5.tar.gz
- ensure identifier re-use doesn't make this break
Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf
-rw-r--r--test/orm/test_collection.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/orm/test_collection.py b/test/orm/test_collection.py
index d059db6e5..f0f4de8a9 100644
--- a/test/orm/test_collection.py
+++ b/test/orm/test_collection.py
@@ -1,4 +1,4 @@
-from sqlalchemy.testing import eq_
+from sqlalchemy.testing import eq_, ne_
import sys
from operator import and_
@@ -1988,7 +1988,8 @@ class CustomCollectionsTest(fixtures.MappedTest):
f = sess.query(Foo).get(f.col1)
assert len(list(f.bars)) == 2
- existing = set([id(b) for b in list(f.bars.values())])
+ strongref = list(f.bars.values())
+ existing = set([id(b) for b in strongref])
col = collections.collection_adapter(f.bars)
col.append_with_event(Bar('b'))
@@ -1999,7 +2000,7 @@ class CustomCollectionsTest(fixtures.MappedTest):
assert len(list(f.bars)) == 2
replaced = set([id(b) for b in list(f.bars.values())])
- self.assert_(existing != replaced)
+ ne_(existing, replaced)
def test_list(self):
self._test_list(list)