feat(setup): T05 configure pytest with coverage

- Create pytest.ini with:
  - Test discovery configuration (testpaths, python_files)
  - Asyncio mode settings
  - Coverage configuration (>=90% requirement)
  - Custom markers (unit, integration, e2e, slow)
- Update conftest.py with:
  - pytest_asyncio plugin
  - Shared fixtures (project_root, src_path, temp_dir, mock_env_vars)
  - Path configuration for imports
- Add test_pytest_config.py with 12 unit tests
- All tests passing (12/12)

Refs: T05

Completes setup phase T01-T05
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 09:55:12 +02:00
parent aece120017
commit 28fde3627e
5 changed files with 191 additions and 6 deletions

32
pytest.ini Normal file
View File

@@ -0,0 +1,32 @@
[pytest]
# Test discovery settings
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# Asyncio settings
asyncio_mode = auto
asyncio_default_fixture_loop_scope = function
# Coverage settings
addopts =
-v
--strict-markers
--tb=short
--cov=src/openrouter_monitor
--cov-report=term-missing
--cov-report=html:htmlcov
--cov-fail-under=90
# Markers
testmarkers =
unit: Unit tests (no external dependencies)
integration: Integration tests (with mocked dependencies)
e2e: End-to-end tests (full workflow)
slow: Slow tests (skip in quick mode)
# Filter warnings
filterwarnings =
ignore::DeprecationWarning:passlib.*
ignore::UserWarning