Skip to content

Commit

Permalink
pypy support for weakref tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzsnz committed Sep 6, 2024
1 parent 5628f9f commit 09cf836
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/event_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import asyncio
import gc
import platform
import unittest

import eventkit as ev
Expand Down Expand Up @@ -42,6 +44,8 @@ def test_functor(self):
self.assertEqual(obj2.value, -1)

del obj2
if platform.python_implementation() == "PyPy":
gc.collect()
self.assertEqual(len(event), 1)
event -= obj1
self.assertNotIn(obj1, event)
Expand All @@ -60,6 +64,8 @@ def test_method(self):
self.assertEqual(obj2.value, -1)

del obj2
if platform.python_implementation() == "PyPy":
gc.collect()
self.assertEqual(len(event), 1)
event -= obj1.method
self.assertNotIn(obj1.method, event)
Expand Down

0 comments on commit 09cf836

Please sign in to comment.