(
self, tmp_path: Path, request: pytest.FixtureRequest
)
| 347 | |
| 348 | @pytest.fixture |
| 349 | def simple_module( |
| 350 | self, tmp_path: Path, request: pytest.FixtureRequest |
| 351 | ) -> Iterator[Path]: |
| 352 | name = f"mymod_{request.node.name}" |
| 353 | fn = tmp_path / f"_src/tests/{name}.py" |
| 354 | fn.parent.mkdir(parents=True) |
| 355 | fn.write_text("def foo(x): return 40 + x", encoding="utf-8") |
| 356 | module_name = module_name_from_path(fn, root=tmp_path) |
| 357 | yield fn |
| 358 | sys.modules.pop(module_name, None) |
| 359 | |
| 360 | def test_importmode_importlib( |
| 361 | self, |
nothing calls this directly
no test coverage detected