mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-09-30 13:43:12 +00:00
23 lines
505 B
Python
23 lines
505 B
Python
|
|
"""Load src/weekly-post/app.py under a unique module name."""
|
||
|
|
|
||
|
|
import importlib.util
|
||
|
|
import pathlib
|
||
|
|
import sys
|
||
|
|
|
||
|
|
import pytest
|
||
|
|
|
||
|
|
_ROOT = pathlib.Path(__file__).resolve().parents[2]
|
||
|
|
|
||
|
|
|
||
|
|
def _load(name, relpath):
|
||
|
|
spec = importlib.util.spec_from_file_location(name, _ROOT / relpath)
|
||
|
|
mod = importlib.util.module_from_spec(spec)
|
||
|
|
sys.modules[name] = mod
|
||
|
|
spec.loader.exec_module(mod)
|
||
|
|
return mod
|
||
|
|
|
||
|
|
|
||
|
|
@pytest.fixture
|
||
|
|
def weeklypost_app():
|
||
|
|
return _load("weeklypost_app", "src/weekly-post/app.py")
|