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:56:06 -0400 |
commit | d6018ef3a29142826a0408456c459c32809cb698 (patch) | |
tree | d4df7741996b9e316d946ebb3669937362507770 | |
parent | 35e879fcded5b21e70d6de840532187f5d304b46 (diff) | |
download | sqlalchemy-d6018ef3a29142826a0408456c459c32809cb698.tar.gz |
- ensure identifier re-use doesn't make this break
Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf
(cherry picked from commit 41549de9609bce90942ca6afc75978d5254c8fd5)
-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 e3c69a9a6..fde9ce412 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_ @@ -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) |