]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix ORM gc-related test that seems to be failing on CI
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 16 Sep 2020 13:50:25 +0000 (09:50 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 16 Sep 2020 14:26:21 +0000 (10:26 -0400)
The test relied on the primary key value not being
of a certain number.

Change-Id: I9bd76bee542da44b630a426f1102fc682ad2d7b3

test/orm/test_hasparent.py

index ac9319466fa589a6434f8131051023846e606a2e..ffc41fb86bb4f11efcf47e3f58ec7ad00ef35732 100644 (file)
@@ -132,6 +132,7 @@ class ParentRemovalTest(fixtures.MappedTest):
         s, u1, a1 = self._fixture()
 
         s._expunge_states([attributes.instance_state(u1)])
+
         del u1
         gc_collect()
 
@@ -140,8 +141,9 @@ class ParentRemovalTest(fixtures.MappedTest):
         # primary key change.  now we
         # can't rely on state.key as the
         # identifier.
-        u1.id = 5
-        a1.user_id = 5
+        new_id = u1.id + 10
+        u1.id = new_id
+        a1.user_id = new_id
         s.flush()
 
         assert_raises_message(