]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- ensure identifier re-use doesn't make this break
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Aug 2017 17:55:49 +0000 (13:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Aug 2017 17:55:49 +0000 (13:55 -0400)
Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf

test/orm/test_collection.py

index d059db6e57858b30415efa27fb33a8180155c75f..f0f4de8a99afba0be0211cd8eedb9c683fced41b 100644 (file)
@@ -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)