void-packages/srcpkgs/python3-lxml/patches/cython3-fix-test.patch

33 lines
1.0 KiB
Diff

diff --git a/src/lxml/tests/test_errors.py b/src/lxml/tests/test_errors.py
index c0aee744..4875f298 100644
--- a/src/lxml/tests/test_errors.py
+++ b/src/lxml/tests/test_errors.py
@@ -28,7 +28,6 @@ class ErrorTestCase(HelperTestCase):
def test_element_cyclic_gc_none(self):
# test if cyclic reference can crash etree
Element = self.etree.Element
- getrefcount = sys.getrefcount
# must disable tracing as it could change the refcounts
trace_func = sys.gettrace()
@@ -36,16 +35,16 @@ class ErrorTestCase(HelperTestCase):
sys.settrace(None)
gc.collect()
- count = getrefcount(None)
+ count1 = gc.get_count()
l = [Element('name'), Element('name')]
l.append(l)
del l
gc.collect()
- count = getrefcount(None) - count
+ count2 = gc.get_count()
- self.assertEqual(count, 0)
+ self.assertEqual(count1, count2)
finally:
sys.settrace(trace_func)