(self)
| 144 | self.assertFalse(os.path.exists(dirpath)) |
| 145 | |
| 146 | def test_forget(self): |
| 147 | mod_filename = TESTFN + '.py' |
| 148 | with open(mod_filename, 'w', encoding="utf-8") as f: |
| 149 | print('foo = 1', file=f) |
| 150 | sys.path.insert(0, os.curdir) |
| 151 | importlib.invalidate_caches() |
| 152 | try: |
| 153 | mod = __import__(TESTFN) |
| 154 | self.assertIn(TESTFN, sys.modules) |
| 155 | |
| 156 | import_helper.forget(TESTFN) |
| 157 | self.assertNotIn(TESTFN, sys.modules) |
| 158 | finally: |
| 159 | del sys.path[0] |
| 160 | os_helper.unlink(mod_filename) |
| 161 | os_helper.rmtree('__pycache__') |
| 162 | |
| 163 | @support.requires_working_socket() |
| 164 | def test_HOST(self): |
nothing calls this directly
no test coverage detected