MCPcopy Index your code
hub / github.com/RustPython/RustPython / tearDown

Method tearDown

Lib/test/test_gc.py:1278–1293  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1276 self.othergarbage = []
1277
1278 def tearDown(self):
1279 # Restore gc state
1280 del self.visit
1281 gc.callbacks.remove(self.cb1)
1282 gc.callbacks.remove(self.cb2)
1283 gc.set_debug(self.debug)
1284 if self.enabled:
1285 gc.enable()
1286 # destroy any uncollectables
1287 gc.collect()
1288 for obj in gc.garbage:
1289 if isinstance(obj, Uncollectable):
1290 obj.partner = None
1291 del gc.garbage[:]
1292 del self.othergarbage
1293 gc.collect()
1294
1295 def preclean(self):
1296 # Remove all fluff from the system. Invoke this function

Callers

nothing calls this directly

Calls 5

isinstanceFunction · 0.85
collectMethod · 0.80
removeMethod · 0.45
set_debugMethod · 0.45
enableMethod · 0.45

Tested by

no test coverage detected