]> 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:56:06 +0000 (13:56 -0400)
Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf
(cherry picked from commit 41549de9609bce90942ca6afc75978d5254c8fd5)

test/orm/test_collection.py

index e3c69a9a6e1c7f127e1a8d0310ef82b8c6f50676..fde9ce41294d41b91d88d910424e52605a479036 100644 (file)
@@ -1,4 +1,4 @@
-from sqlalchemy.testing import eq_
+from sqlalchemy.testing import eq_, ne_
 import sys
 from operator import and_
 
@@ -1984,7 +1984,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'))
@@ -1995,7 +1996,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)