MCPcopy Index your code
hub / github.com/numpy/numpy / test_refcount

Method test_refcount

numpy/_core/tests/test_arrayprint.py:554–565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

552 @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
553 @pytest.mark.thread_unsafe(reason="garbage collector is global state")
554 def test_refcount(self):
555 # make sure we do not hold references to the array due to a recursive
556 # closure (gh-10620)
557 gc.disable()
558 a = np.arange(2)
559 r1 = sys.getrefcount(a)
560 np.array2string(a)
561 np.array2string(a)
562 r2 = sys.getrefcount(a)
563 gc.collect()
564 gc.enable()
565 assert_(r1 == r2)
566
567 def test_with_sign(self):
568 # mixed negative and positive value array

Callers

nothing calls this directly

Calls 2

assert_Function · 0.90
enableMethod · 0.80

Tested by

no test coverage detected