Refactor: PHASE 8: Testing & Integration

This commit is contained in:
ziesorx 2025-09-12 18:55:23 +07:00
parent af34f4fd08
commit 9e8c6804a7
32 changed files with 17128 additions and 0 deletions

78
tox.ini Normal file
View file

@ -0,0 +1,78 @@
[tox]
envlist = py39,py310,py311,py312,py313,flake8,mypy,coverage
skipsdist = True
isolated_build = True
[testenv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
commands = python scripts/run_tests.py --unit --no-coverage
setenv =
PYTHONPATH = {toxinidir}
DETECTOR_WORKER_ENV = test
[testenv:integration]
commands = python scripts/run_tests.py --integration
[testenv:performance]
commands = python scripts/run_tests.py --performance
[testenv:flake8]
deps = flake8
flake8-docstrings
flake8-import-order
commands = flake8 detector_worker tests scripts
[testenv:mypy]
deps = mypy
types-redis
types-requests
types-PyYAML
commands = mypy detector_worker --ignore-missing-imports
[testenv:coverage]
commands = python scripts/run_tests.py --coverage
[testenv:format]
deps = black
isort
commands =
black detector_worker tests scripts
isort detector_worker tests scripts
[testenv:security]
deps = bandit
safety
commands =
bandit -r detector_worker
safety check
[testenv:docs]
deps = sphinx
sphinx-rtd-theme
commands = sphinx-build -b html docs docs/_build
[flake8]
max-line-length = 120
extend-ignore = E203,W503,E501
exclude = .git,__pycache__,build,dist,*.egg-info,.tox
per-file-ignores =
__init__.py:F401
tests/*:S101,S105,S106
[coverage:run]
source = detector_worker
omit =
*/tests/*
*/test_*
*/__pycache__/*
[coverage:report]
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
@abstractmethod