MCPcopy Create free account
hub / github.com/numpy/numpy / test_mem_seteventhook

Method test_mem_seteventhook

numpy/core/tests/test_deprecations.py:636–650  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

634class TestMemEventHook(_DeprecationTestCase):
635 # Deprecated 2021-11-18, NumPy 1.23
636 def test_mem_seteventhook(self):
637 # The actual tests are within the C code in
638 # multiarray/_multiarray_tests.c.src
639 import numpy.core._multiarray_tests as ma_tests
640 with pytest.warns(DeprecationWarning,
641 match='PyDataMem_SetEventHook is deprecated'):
642 ma_tests.test_pydatamem_seteventhook_start()
643 # force an allocation and free of a numpy array
644 # needs to be larger then limit of small memory cacher in ctors.c
645 a = np.zeros(1000)
646 del a
647 break_cycles()
648 with pytest.warns(DeprecationWarning,
649 match='PyDataMem_SetEventHook is deprecated'):
650 ma_tests.test_pydatamem_seteventhook_end()
651
652
653class TestArrayFinalizeNone(_DeprecationTestCase):

Callers

nothing calls this directly

Calls 1

break_cyclesFunction · 0.90

Tested by

no test coverage detected