()
| 2686 | @pytest.mark.thread_unsafe(reason="garbage collector is global state") |
| 2687 | @pytest.mark.slow |
| 2688 | def test_load_refcount(): |
| 2689 | # Check that objects returned by np.load are directly freed based on |
| 2690 | # their refcount, rather than needing the gc to collect them. |
| 2691 | |
| 2692 | f = BytesIO() |
| 2693 | np.savez(f, [1, 2, 3]) |
| 2694 | f.seek(0) |
| 2695 | |
| 2696 | with assert_no_gc_cycles(): |
| 2697 | np.load(f) |
| 2698 | |
| 2699 | f.seek(0) |
| 2700 | dt = [("a", 'u1', 2), ("b", 'u1', 2)] |
| 2701 | with assert_no_gc_cycles(): |
| 2702 | x = np.loadtxt(TextIO("0 1 2 3"), dtype=dt) |
| 2703 | assert_equal(x, np.array([((0, 1), (2, 3))], dtype=dt)) |
| 2704 | |
| 2705 | |
| 2706 | def test_load_multiple_arrays_until_eof(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…