summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-05-09 12:42:19 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-05-09 12:42:19 -0400
commit17306220498cea779f360d03eeb5aadac3ccb59f (patch)
tree659e6fc6fc7ec58c9e5ce20e5ac45d1616c8b290
parentf8bb1c102258c321769edaa3daaa3eb73a135877 (diff)
downloadsqlalchemy-17306220498cea779f360d03eeb5aadac3ccb59f.tar.gz
reset session on new #6449 test for pypy
Change-Id: If1c8c755a7e9c0191c1666a13b9e920effbeb5bc
-rw-r--r--test/orm/test_expire.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/orm/test_expire.py b/test/orm/test_expire.py
index 4ef585f27..0e356fe78 100644
--- a/test/orm/test_expire.py
+++ b/test/orm/test_expire.py
@@ -772,7 +772,12 @@ class ExpireTest(_fixtures.FixtureTest):
# contains_eager().contains_eager() worked as expected
asserter.assert_(CountStatements(1))
+ # expire object, reset the session fully and re-add so that
+ # the related User / Order objects are not in the identity map,
+ # allows SQL count below to be deterministic
sess.expire(a1)
+ sess.close()
+ sess.add(a1)
# assert behavior on unexpire
with self.sql_execution_asserter(testing.db) as asserter: