Skip to content

Commit f68187c

Browse files
committed
test_memoryview.py: explicit release of memoryviews, no reliable way to check for ref gc
1 parent cb45f8d commit f68187c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@
3737
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3838
# SOFTWARE.
3939

40-
import sys
41-
import time
42-
import gc
4340
import itertools
44-
import weakref
41+
import sys
42+
4543
from . import CPyExtTestCase, CPyExtFunction, CPyExtType, unhandled_error_compare_with_message, unhandled_error_compare
44+
4645
__dir__ = __file__.rpartition("/")[0]
4746

4847
indices = (-2, 2, 10)
@@ -408,12 +407,6 @@ def test_memoryview_acquire_release(self):
408407
assert mv2[3] == 126
409408
mv2.release()
410409
assert mv3[2] == 126
411-
del mv1
412-
mv3ref = weakref.ref(mv3)
413-
del mv3
414-
while mv3ref() is not None:
415-
gc.collect()
416-
if obj.get_bufcount() == 0:
417-
break
418-
time.sleep(1)
410+
mv1.release()
411+
mv3.release()
419412
assert obj.get_bufcount() == 0

0 commit comments

Comments
 (0)