(self)
| 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 |