MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_reference_internal

Function test_reference_internal

tests/test_eigen_tensor.py:67–78  ·  view source on GitHub ↗
(m, member_name)

Source from the content-addressed store, hash-verified

65@pytest.mark.parametrize("member_name", ["member", "member_view"])
66@pytest.mark.skipif("env.GRAALPY", reason="Different refcounting mechanism")
67def 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
81assert_equal_funcs = [

Callers

nothing calls this directly

Calls 3

hasattrFunction · 0.85
getattrFunction · 0.85
assert_equal_tensor_refFunction · 0.85

Tested by

no test coverage detected