def test_importmode_importlib(
        self,
        simple_module: Path,
        tmp_path: Path,
        request: pytest.FixtureRequest,
        ns_param: bool,
    ) -> None:
        """`importlib` mode does not change sys.path."""
        module = import_path(
            simple_module,
            mode="importlib",
            root=tmp_path,
            consider_namespace_packages=ns_param,
        )
        assert module.foo(2) == 42
        assert str(simple_module.parent) not in sys.path
        assert module.__name__ in sys.modules
        assert module.__name__ == f"_src.tests.mymod_{request.node.name}"
        assert "_src" in sys.modules
        assert "_src.tests" in sys.modules
`importlib` mode does not change sys.path.
testing/test_pathlib.py