Files
llmsecops-research/tests/pytest.ini
2025-07-25 08:47:56 -06:00

128 lines
3.2 KiB
INI

# pytest.ini - Comprehensive configuration for unit, integration, and e2e tests
[pytest]
# Minimum pytest version required
minversion = 6.0
# Test discovery patterns
python_files = test_*.py *_test.py
python_classes = Test* *Tests
python_functions = test_*
# Custom markers
markers =
unit: marks tests as unit tests
integration: marks tests as integration tests
e2e: marks tests as end-to-end tests
slow: marks tests as slow
repository: mark as repository-focused tests
mitigation: mark as mitigation
# Test paths - pytest will look for tests in these directories
testpaths =
tests
tests/unit
tests/integration
tests/e2e
# Additional command line options (applied to every pytest run)
addopts =
-v
-ra
--tb=short
--strict-markers
--strict-config
--capture=no
--durations=10
--cov=src
--cov-report=term-missing
--cov-report=html:htmlcov
--cov-report=xml
--cov-fail-under=25
--ignore-glob=**/migrations/*
--ignore-glob=**/.tox/*
--ignore-glob=**/build/*
--ignore-glob=**/dist/*
--ignore-glob=**/*.egg
--ignore-glob=**/.git/*
--ignore-glob=**/__pycache__/*
--ignore-glob=**/.pytest_cache/*
--ignore-glob=**/node_modules/*
--ignore-glob=**/.env/*
# Ignore certain directories and files during test collection
norecursedirs =
setup.py
conftest.py
migrations/
.tox/
build/
dist/
*.egg
.git/
__pycache__/
.pytest_cache/
node_modules/
.env/
# Configure logging
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
log_file = tests/logs/pytest.log
log_file_level = DEBUG
log_file_format = %(asctime)s [%(levelname)8s] %(filename)s:%(lineno)d: %(message)s
log_file_date_format = %Y-%m-%d %H:%M:%S
# Configure warnings
filterwarnings =
error
ignore::UserWarning
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
ignore:.*U.*mode is deprecated:DeprecationWarning
# Test timeout (requires pytest-timeout)
timeout = 3000
timeout_method = thread
# Parallel execution configuration (requires pytest-xdist)
# Uncomment to enable parallel test execution
# addopts = -n auto
# Minimum line length for test output
console_output_style = progress
# Configure doctest options
doctest_optionflags =
NORMALIZE_WHITESPACE
IGNORE_EXCEPTION_DETAIL
ELLIPSIS
# Configure test session data
cache_dir = .pytest_cache
# Configure temporary directory for tests
tmp_path_retention_count = 3
tmp_path_retention_policy = failed
# Additional ini options for specific plugins can be added here
# For example, if using pytest-mock:
# mock_use_standalone_module = true
# For pytest-html reports:
# addopts = --html=reports/report.html --self-contained-html
# For pytest-bdd:
# bdd_features_base_dir = features/
# Environment variables can be set (requires pytest-env)
env =
export MODEL_BASE_DIR="./infrastructure/foundation_model"
export MODEL_CPU_DIR="cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4"
MODEL_DATA_FILENAME="phi3-mini-4k-instruct-cpu-int4-rtn-block-32-acc-level-4.onnx.data"
MODEL_DATA_FILEPATH="$MODEL_BASE_DIR/$MODEL_CPU_DIR/$MODEL_DATA_FILENAME"