Files
instameex/tests/conftest.py
T
Djeex 4e7b51c334
CI / build-and-scan (pull_request) Failing after 2m9s
Add CI/CD pipeline, Renovate config and unit tests
2026-11-21 16:15:14 +00:00

29 lines
627 B
Python

import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT / "src" / "script"))
sys.path.insert(0, str(ROOT))
@pytest.fixture
def jobs_dir(tmp_path, monkeypatch):
from app import jobs
monkeypatch.setattr(jobs, "JOBS_DIR", tmp_path / "jobs")
jobs.JOBS.clear()
yield tmp_path / "jobs"
jobs.JOBS.clear()
@pytest.fixture
def client(jobs_dir, monkeypatch):
from app import create_app, jobs
monkeypatch.setattr(jobs, "start_reaper", lambda: None)
app = create_app()
app.config["TESTING"] = True
return app.test_client()