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

Method clean_up

Lib/test/test_import/__init__.py:2723–2733  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

2721
2722 @classmethod
2723 def clean_up(cls):
2724 name = cls.NAME
2725 if name in sys.modules:
2726 if hasattr(sys.modules[name], '_clear_globals'):
2727 assert sys.modules[name].__file__ == cls.FILE, \
2728 f"{sys.modules[name].__file__} != {cls.FILE}"
2729
2730 sys.modules[name]._clear_globals()
2731 del sys.modules[name]
2732 # Clear all internally cached data for the extension.
2733 _testinternalcapi.clear_extension(name, cls.ORIGIN)
2734
2735 #########################
2736 # helpers

Callers 2

tearDownMethod · 0.95
setUpClassMethod · 0.80

Calls 4

hasattrFunction · 0.85
execMethod · 0.80
dedentMethod · 0.80
destroyMethod · 0.45

Tested by

no test coverage detected