1.2 KiB
1.2 KiB
| paths | |
|---|---|
|
Testing rule
Tests mirror the source layout: tests/unit/test_<layer>/...,
tests/integration/..., tests/e2e/....
- Structure:
tests/unit/mirrorssrc/everos/package-for-package. Put a test next to where its subject lives in the mirror. - Async:
pytest-asynciois inautomode — writeasync def test_*directly, no marker needed. - Markers (default run excludes both —
-m "not slow and not live_llm"):@pytest.mark.slow— tests ≥ ~10s.@pytest.mark.live_llm— needs real LLM/embedder credentials. Keep unit tests fast and credential-free; push anything needing real services behind a marker or intointegration/e2e.
- Fixtures: shared fixtures live in the nearest
conftest.py. The root conftest resets module caches (settings/logging/datetime) per test — rely on that for isolation rather than mutating globals. - Module docstring on each test file stating what contract it pins (see existing tests for the style).
- Coverage gate:
make covenforces 80% (--cov-fail-under=80). New code should not drop coverage below the gate. - Run
make test(unit) andmake integrationbefore pushing; both run in CI.