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

Method test_forget

Lib/test/test_support.py:137–152  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

135 self.assertFalse(os.path.exists(dirpath))
136
137 def test_forget(self):
138 mod_filename = TESTFN + '.py'
139 with open(mod_filename, 'w', encoding="utf-8") as f:
140 print('foo = 1', file=f)
141 sys.path.insert(0, os.curdir)
142 importlib.invalidate_caches()
143 try:
144 mod = __import__(TESTFN)
145 self.assertIn(TESTFN, sys.modules)
146
147 import_helper.forget(TESTFN)
148 self.assertNotIn(TESTFN, sys.modules)
149 finally:
150 del sys.path[0]
151 os_helper.unlink(mod_filename)
152 os_helper.rmtree('__pycache__')
153
154 @support.requires_working_socket()
155 def test_HOST(self):

Callers

nothing calls this directly

Calls 9

assertInMethod · 0.80
assertNotInMethod · 0.80
openFunction · 0.50
printFunction · 0.50
__import__Function · 0.50
insertMethod · 0.45
invalidate_cachesMethod · 0.45
forgetMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected