MCPcopy Index your code
hub / github.com/python/cpython / test_dont_clear_dict

Method test_dont_clear_dict

Lib/test/test_module/__init__.py:97–104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

95 self.assertTrue(foo.__dict__ is d)
96
97 def test_dont_clear_dict(self):
98 # See issue 7140.
99 def f():
100 foo = ModuleType("foo")
101 foo.bar = 4
102 return foo
103 gc_collect()
104 self.assertEqual(f().__dict__["bar"], 4)
105
106 def test_clear_dict_in_ref_cycle(self):
107 destroyed = []

Callers

nothing calls this directly

Calls 3

gc_collectFunction · 0.90
fFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected