From 17306220498cea779f360d03eeb5aadac3ccb59f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 9 May 2021 12:42:19 -0400 Subject: [PATCH] reset session on new #6449 test for pypy Change-Id: If1c8c755a7e9c0191c1666a13b9e920effbeb5bc --- test/orm/test_expire.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/orm/test_expire.py b/test/orm/test_expire.py index 4ef585f271..0e356fe783 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: -- 2.47.3