A Python flow project's package name, unimported again after the test.
(project: Path, request: pytest.FixtureRequest)
| 492 | |
| 493 | @pytest.fixture |
| 494 | def flow_package(project: Path, request: pytest.FixtureRequest) -> str: |
| 495 | """A Python flow project's package name, unimported again after the test.""" |
| 496 | package = f"usage_flow_{uuid.uuid4().hex}" |
| 497 | write( |
| 498 | project / "pyproject.toml", |
| 499 | FLOW_PYPROJECT + f'\n[project.scripts]\nkickoff = "{package}.main:kickoff"\n', |
| 500 | ) |
| 501 | write(project / "src" / package / "__init__.py", "") |
| 502 | request.addfinalizer(lambda: sys.modules.pop(f"{package}.main", None)) |
| 503 | request.addfinalizer(lambda: sys.modules.pop(package, None)) |
| 504 | return package |
| 505 | |
| 506 | |
| 507 | @pytest.mark.parametrize( |