(self)
| 57 | self.assertIsNone(self.find('module', [])) |
| 58 | |
| 59 | def test_path_hooks(self): |
| 60 | # Test that sys.path_hooks is used. |
| 61 | # Test that sys.path_importer_cache is set. |
| 62 | module = '<test module>' |
| 63 | path = '<test path>' |
| 64 | importer = util.mock_spec(module) |
| 65 | hook = util.mock_path_hook(path, importer=importer) |
| 66 | with util.import_state(path_hooks=[hook]): |
| 67 | found = self.find(module, [path]) |
| 68 | self.check_found(found, importer) |
| 69 | self.assertIn(path, sys.path_importer_cache) |
| 70 | self.assertIs(sys.path_importer_cache[path], importer) |
| 71 | |
| 72 | def test_empty_path_hooks(self): |
| 73 | # Test that if sys.path_hooks is empty a warning is raised, |
nothing calls this directly
no test coverage detected