Tussilago/conftest.py
2026-04-27 20:43:26 +02:00

30 lines
819 B
Python

import os
from typing import TYPE_CHECKING
from typing import Any
import pytest
import zeal # pyright: ignore[reportMissingTypeStubs]
if TYPE_CHECKING:
from collections.abc import Generator
@pytest.fixture(autouse=True)
def use_zeal() -> Generator[None, Any]:
"""Enable Zeal N+1 detection context for each pytest test."""
with zeal.zeal_context():
yield
def pytest_configure(config: pytest.Config) -> None:
"""Register local markers used by opt-in host smoke coverage."""
config.addinivalue_line(
"markers",
"host_smoke: opt-in host-level smoke tests that spawn real local processes",
)
@pytest.fixture
def host_smoke_enabled() -> bool:
"""Return whether opt-in host smoke coverage should run."""
return os.getenv("TUSSILAGO_RUN_HOST_SMOKE", "0") == "1"