From: Mike Bayer Date: Tue, 22 Aug 2017 17:55:49 +0000 (-0400) Subject: - ensure identifier re-use doesn't make this break X-Git-Tag: origin~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41549de9609bce90942ca6afc75978d5254c8fd5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - ensure identifier re-use doesn't make this break Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf --- diff --git a/test/orm/test_collection.py b/test/orm/test_collection.py index d059db6e57..f0f4de8a99 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)