diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-08-22 13:55:49 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2017-08-22 13:55:49 -0400 |
commit | 41549de9609bce90942ca6afc75978d5254c8fd5 (patch) | |
tree | 7df8b5cf54d9049cc0808360d5e8ed3571080802 | |
parent | 4c306818396c8cc98a16a14c5ed3361cf6ff373a (diff) | |
download | sqlalchemy-41549de9609bce90942ca6afc75978d5254c8fd5.tar.gz |
- ensure identifier re-use doesn't make this break
Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf
-rw-r--r-- | test/orm/test_collection.py | 7 |
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) |