"""Finite preparation. No service process is started here."""
from pathlib import Path
import subprocess
import sys

ROOT = Path(__file__).resolve().parents[1]
for arguments in (["scripts/build_catalog.py"], ["scripts/check_catalog.py"],
                  ["-m", "unittest", "discover", "-s", "tests", "-v"]):
    result = subprocess.run([sys.executable] + arguments, cwd=ROOT, timeout=20)
    if result.returncode:
        raise SystemExit(result.returncode)
print("preparation complete; no service started", flush=True)
