(m, member_name)
| 65 | @pytest.mark.parametrize("member_name", ["member", "member_view"]) |
| 66 | @pytest.mark.skipif("env.GRAALPY", reason="Different refcounting mechanism") |
| 67 | def test_reference_internal(m, member_name): |
| 68 | if not hasattr(sys, "getrefcount"): |
| 69 | pytest.skip("No reference counting") |
| 70 | foo = m.CustomExample() |
| 71 | counts = sys.getrefcount(foo) |
| 72 | mem = getattr(foo, member_name) |
| 73 | assert_equal_tensor_ref(mem, writeable=False) |
| 74 | new_counts = sys.getrefcount(foo) |
| 75 | assert new_counts == counts + 1 |
| 76 | assert_equal_tensor_ref(mem, writeable=False) |
| 77 | del mem |
| 78 | assert sys.getrefcount(foo) == counts |
| 79 | |
| 80 | |
| 81 | assert_equal_funcs = [ |
nothing calls this directly
no test coverage detected