Skip to content

Commit 04c8653

Browse files
committed
Add more gc cycles to cpyext memoryview test
1 parent 742fb2a commit 04c8653

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_memoryview.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ def test_memoryview_acquire_release(self):
409409
assert mv3[2] == 126
410410
del mv1
411411
del mv3
412-
gc.collect()
413-
time.sleep(1)
412+
for i in range(10):
413+
gc.collect()
414+
time.sleep(0.1)
414415
assert obj.get_bufcount() == 0

graalpython/lib-python/3/test/test_memoryview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def setitem(key, value):
120120
# Adding an expensive separate pre-check for multislices is not worth it and if CPython ever implements
121121
# multislices, this is going to raise the same TypeError as we do.
122122
# self.assertRaises(NotImplementedError, setitem, slices, b"a")
123-
self.assertRaises(TypeError, setitem, slices, b"a")
123+
self.assertRaises((NotImplementedError, TypeError), setitem, slices, b"a")
124124
# Trying to resize the memory object
125125
exc = ValueError if m.format == 'c' else TypeError
126126
self.assertRaises(exc, setitem, 0, b"")

0 commit comments

Comments
 (0)