(self)
| 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 | |
| 527 | class TestPrintOptions: |
| 528 | """Test getting and setting global print options.""" |