Files
orion/enhanced_pytest_config.txt
2025-09-19 16:54:13 +02:00

80 lines
2.2 KiB
Plaintext

# pytest.ini - Enhanced configuration for your FastAPI test suite
[tool:pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# Enhanced addopts for better development experience
addopts =
-v
--tb=short
--strict-markers
--strict-config
--color=yes
--durations=10
--showlocals
-ra
--cov=app
--cov=models
--cov=utils
--cov=middleware
--cov-report=term-missing
--cov-report=html:htmlcov
--cov-fail-under=80
# Test discovery and execution settings
minversion = 6.0
testmon = true
python_paths = .
# Markers for your specific test organization
markers =
# Test Types (for your new structure)
unit: Unit tests - fast, isolated components
integration: Integration tests - multiple components working together
system: System tests - full application behavior
e2e: End-to-end tests - complete user workflows
# Performance and Speed
slow: Slow running tests (deselect with '-m "not slow"')
performance: Performance and load tests
# Domain-specific markers (matching your application structure)
auth: Authentication and authorization tests
products: Product management functionality
stock: Stock and inventory management
shops: Shop management functionality
admin: Admin functionality and permissions
marketplace: Marketplace import functionality
stats: Statistics and reporting
# Infrastructure markers
database: Tests that require database operations
external: Tests that require external services
api: API endpoint tests
security: Security-related tests
# Test environment markers
ci: Tests that should only run in CI
dev: Development-specific tests
# Test filtering shortcuts
filterwarnings =
ignore::UserWarning
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
ignore::sqlalchemy.exc.SAWarning
# Timeout settings
timeout = 300
timeout_method = thread
# Parallel execution settings (uncomment if using pytest-xdist)
# addopts = -n auto
# Additional logging configuration
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S