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

Method test_refcount

numpy/core/tests/test_arrayprint.py:514–525  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

512
513 @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
514 def test_refcount(self):
515 # make sure we do not hold references to the array due to a recursive
516 # closure (gh-10620)
517 gc.disable()
518 a = np.arange(2)
519 r1 = sys.getrefcount(a)
520 np.array2string(a)
521 np.array2string(a)
522 r2 = sys.getrefcount(a)
523 gc.collect()
524 gc.enable()
525 assert_(r1 == r2)
526
527class TestPrintOptions:
528 """Test getting and setting global print options."""

Callers

nothing calls this directly

Calls 2

assert_Function · 0.90
enableMethod · 0.80

Tested by

no test coverage detected