# pytest.ini - Pytest configuration for Tenets
# This file must be in INI format, not TOML format
# Place this file in your project root directory
[pytest]
# Minimum pytest version required
minversion = 7.0
# Test discovery patterns
# These patterns tell pytest which files/classes/functions are tests
python_files = test_*.py *_test.py
python_classes = Test* *Tests
python_functions = test_*
# Default command line options
# These are applied every time pytest runs
addopts =
# Show all test outcomes with short summary
-ra
# Strict mode - treat warnings as errors
--strict-markers
--strict-config
# Coverage settings
--cov=tenets
--cov-branch
--cov-report=term-missing:skip-covered
--cov-report=xml
--cov-report=html
--no-cov-on-fail
# JUnit XML output for CI/CD and test analytics
--junitxml=junit.xml
-o junit_family=legacy
# Show 10 slowest tests
--durations=10
# Use importlib import mode to avoid duplicate test module basename collisions
--import-mode=importlib
# Test paths - where to look for tests
testpaths = tests
# Add project root to Python path
pythonpath = .
# Custom markers for organizing/filtering tests
# Run specific markers with: pytest -m "marker_name"
# Skip markers with: pytest -m "not slow"
markers =
unit: Unit tests with mocked dependencies (fast, isolated)
integration: Integration tests with real components
slow: Tests that take more than 1 second
requires_git: Tests that require a git repository
requires_ml: Tests that require ML dependencies (torch, transformers, etc.)
cli: CLI command tests
smoke: Quick smoke tests for CI (critical path only)
network: Tests that require network access
destructive: Tests that modify files/state (run with caution)
# Filter out specific warnings
# Add more warning filters as needed
filterwarnings =
# Ignore deprecation warnings from dependencies
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
# Ignore ResourceWarning from coverage.py SQLite database
ignore::ResourceWarning:coverage.parser
ignore::ResourceWarning:sqlite3
# Console output settings
console_output_style = progress
# Fail test run if no tests collected (safety check)
# Comment out during development if needed
required_plugins = pytest-cov pytest-xdist pytest-timeout
# Note: import mode is configured via addopts above for broad compatibility
# Timeout settings (requires pytest-timeout)
# Global timeout of 300 seconds per test
timeout = 300
timeout_method = thread
# Log settings
log_cli = false
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
# Capture settings
# Change to 'no' to see print statements during test runs
; capture = sys