We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83ffa01 commit 2d6e031Copy full SHA for 2d6e031
pymunk/tests/test_space.py
@@ -1170,17 +1170,20 @@ def testPickleCachedArbiters(self) -> None:
1170
1171
def testDeleteSpaceWithObjects(self) -> None:
1172
s = p.Space()
1173
-
1174
b = p.Body(1)
1175
1176
c = p.Circle(b, 10)
1177
1178
- j = p.PinJoint(b, s.static_body)
+ static_body = s.static_body # to stop it from GC
+ j = p.PinJoint(b, static_body)
1179
1180
s.add(b, c, j)
1181
1182
del s
1183
+ # needed for pypy
+ import gc
1184
+
1185
+ gc.collect()
1186
1187
self.assertIsNone(b.space)
1188
self.assertIsNone(c.space)
1189
self.assertEqual(j.a, b)
0 commit comments