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

Method test_threaded_weak_valued_pop

Lib/test/test_weakref.py:1961–1967  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1959
1960 @threading_helper.requires_working_threading()
1961 def test_threaded_weak_valued_pop(self):
1962 d = weakref.WeakValueDictionary()
1963 with collect_in_thread():
1964 for i in range(self.NUM_THREADED_ITERATIONS):
1965 d[10] = RefCycle()
1966 x = d.pop(10, 10)
1967 self.assertIsNot(x, None) # we never put None in there!
1968
1969 @threading_helper.requires_working_threading()
1970 def test_threaded_weak_valued_consistency(self):

Callers

nothing calls this directly

Calls 4

popMethod · 0.95
collect_in_threadFunction · 0.85
assertIsNotMethod · 0.80
RefCycleClass · 0.70

Tested by

no test coverage detected