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

Method _assertTruesurvival

Lib/test/test_logging.py:2254–2264  ·  view source on GitHub ↗

Assert that all objects watched for survival have survived.

(self)

Source from the content-addressed store, hash-verified

2252 self._survivors[key] = weakref.ref(obj)
2253
2254 def _assertTruesurvival(self):
2255 """Assert that all objects watched for survival have survived."""
2256 # Trigger cycle breaking.
2257 gc.collect()
2258 dead = []
2259 for (id_, repr_), ref in self._survivors.items():
2260 if ref() is None:
2261 dead.append(repr_)
2262 if dead:
2263 self.fail("%d objects should have survived "
2264 "but have been destroyed: %s" % (len(dead), ", ".join(dead)))
2265
2266 def test_persistent_loggers(self):
2267 # Logger objects are persistent and retain their configuration, even

Callers 1

Calls 5

collectMethod · 0.45
itemsMethod · 0.45
appendMethod · 0.45
failMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected