[pytest]
# Test discovery
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
norecursedirs = bengal .git .tox dist build *.egg .hypothesis .pytest_cache

# Async test support
asyncio_mode = auto

# Pytest options (fast PR default: exclude long-running suites)
# -v: verbose (show test names, especially useful for failures)
# --tb=short: concise tracebacks (shows file:line for each frame)
# -ra: show summary of all test outcomes (passed, failed, skipped, etc.)
# --durations=10: show 10 slowest tests
addopts = -n auto -v --tb=short -ra --durations=10 -m "not performance and not stateful and not slow"

# Console output
# Note: -v overrides progress style, showing test names instead of dots
# This makes failures immediately visible with test names
console_output_style = progress

# Timeout configuration (prevent hanging tests)
# thread method is required: signal method causes deadlocks when
# ThreadPoolExecutor.__exit__ calls shutdown(wait=True) after SIGALRM fires
timeout = 300
timeout_method = thread

# Warnings
filterwarnings =
    error::DeprecationWarning
    ignore::pytest.PytestUnraisableExceptionWarning
    ignore::DeprecationWarning
    ignore::PendingDeprecationWarning
    ignore::pytest_benchmark.logger.PytestBenchmarkWarning

# Temporary directory retention (keep failed test dirs for debugging)
tmp_path_retention_count = 3
tmp_path_retention_policy = failed

# Markers
markers =
    unit: Unit tests (fast, isolated)
    integration: Integration tests (slower, multiple components)
    e2e: End-to-end tests (full workflows)
    cli: CLI command tests
    requires_network: Tests requiring internet access
    parallel_unsafe: Tests that cannot run in parallel with pytest-xdist (uses ThreadPoolExecutor/ProcessPoolExecutor internally, global state conflicts)
    memory_intensive: Tests using >500MB RAM
    hypothesis: Property-based tests using Hypothesis
    serial: tests that must run sequentially (no parallel, similar to parallel_unsafe)
    slow: Slow tests (long-running, typically >10s)
    performance: Performance/benchmark or high-scale tests (exclude by default)
    stateful: Long-running state-machine/workflow tests (exclude by default)
    autodoc: Tests requiring pre-built site (site/public); run after docs build
    known_gap: XFAIL tests documenting known issues; run in nightly only
    heavyweight: Tests that typically exceed ~15s (full site builds, large roots); for reporting

# Coverage options
[coverage:run]
source = bengal
omit =
    */tests/*
    */test_*.py
    */__pycache__/*

[coverage:report]
fail_under = 85
exclude_lines =
    pragma: no cover
    def __repr__
    def __str__
    raise AssertionError
    raise NotImplementedError
    if __name__ == .__main__.:
    if TYPE_CHECKING:
    @abstractmethod
    @abc.abstractmethod
