Includes atomic migrations, per-rule reminder semantics, first-run helper script and the note on the undecided UI chat idea. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
28 lines
863 B
Python
28 lines
863 B
Python
import importlib
|
|
import pkgutil
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
import app
|
|
|
|
ROOT = Path(app.__file__).resolve().parent.parent
|
|
MODULES = sorted(info.name for info in pkgutil.walk_packages(app.__path__, "app."))
|
|
TOP_LEVEL = sorted({name.split(".")[1] for name in MODULES} | {"main"})
|
|
FRESH_IMPORT_TIMEOUT = 60
|
|
|
|
|
|
@pytest.mark.parametrize("name", MODULES)
|
|
def test_module_imports(name):
|
|
importlib.import_module(name)
|
|
|
|
|
|
@pytest.mark.parametrize("name", TOP_LEVEL)
|
|
def test_top_level_import_in_fresh_interpreter(name):
|
|
# Zyklen zeigen sich oft nur, wenn ein Modul als erstes importiert wird.
|
|
result = subprocess.run([sys.executable, "-c", f"import app.{name}"], cwd=ROOT, capture_output=True,
|
|
text=True, timeout=FRESH_IMPORT_TIMEOUT)
|
|
assert result.returncode == 0, result.stderr[-2000:]
|