(self)
| 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): |
nothing calls this directly
no test coverage detected