`importlib` mode does not change sys.path.
(self, simple_module: Path, tmp_path: Path)
| 277 | return fn |
| 278 | |
| 279 | def test_importmode_importlib(self, simple_module: Path, tmp_path: Path) -> None: |
| 280 | """`importlib` mode does not change sys.path.""" |
| 281 | module = import_path(simple_module, mode="importlib", root=tmp_path) |
| 282 | assert module.foo(2) == 42 # type: ignore[attr-defined] |
| 283 | assert str(simple_module.parent) not in sys.path |
| 284 | assert module.__name__ in sys.modules |
| 285 | assert module.__name__ == "_src.tests.mymod" |
| 286 | assert "_src" in sys.modules |
| 287 | assert "_src.tests" in sys.modules |
| 288 | |
| 289 | def test_importmode_twice_is_different_module( |
| 290 | self, simple_module: Path, tmp_path: Path |
nothing calls this directly
no test coverage detected