7 from pybind11_tests
import custom_type_setup
as m
12 """Tests that an object is garbage collected.
14 Assumes that any unreferenced objects are fully collected after calling
15 `gc.collect()`. That is true on CPython, but does not appear to reliably
24 assert gc.is_tracked(obj)
25 weak_refs.append(weakref.ref(obj))
35 @pytest.mark.skipif(
"env.PYPY")
37 obj = m.OwnsPythonObjects()
43 @pytest.mark.skipif(
"env.PYPY")
45 obj = m.OwnsPythonObjects()