[pytest]
# Pytest configuration for TimeTracker

# Test discovery patterns
python_files = test_*.py
python_classes = Test*
python_functions = test_*

# Test paths
testpaths = tests

# Output options
addopts =
    # Verbosity and output
    -v
    --tb=short
    --strict-markers
    --color=yes
    
    # Warnings
    -W ignore::DeprecationWarning
    -W ignore::PendingDeprecationWarning
    
    # Performance
    --durations=10

# Note: Coverage fail-under should only be used when running ALL tests
# Do NOT use --cov-fail-under when running specific test markers (e.g., -m routes)

# Test markers for different test levels
markers =
    smoke: Quick smoke tests (fastest, runs on every commit)
    unit: Unit tests (fast, isolated tests)
    integration: Integration tests (medium speed, tests component interaction)
    api: API endpoint tests
    database: Database-related tests
    models: Model tests
    routes: Route/endpoint tests
    utils: Utility/helper function tests
    security: Security-related tests
    invoices: Invoice-related tests
    performance: Performance and load tests
    slow: Slow running tests
    requires_db: Tests that require database connection
    requires_network: Tests that require network access
    skip_ci: Tests to skip in CI environment

# Coverage configuration
[coverage:run]
source = app
omit =
    */tests/*
    */test_*.py
    */__pycache__/*
    */venv/*
    */env/*
    app/utils/pdf_generator.py
    app/utils/pdf_generator_fallback.py

[coverage:report]
precision = 2
show_missing = True
skip_covered = False

[coverage:html]
directory = htmlcov

