This commit is contained in:
2025-09-24 09:21:03 +08:00
parent 6d37e7c23c
commit dfb07d679f
14 changed files with 2378 additions and 1 deletions

53
pytest.ini Normal file
View File

@@ -0,0 +1,53 @@
[tool:pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# 标记定义
markers =
integration: marks tests as integration tests (may be slow)
unit: marks tests as unit tests (fast)
slow: marks tests as slow running
stress: marks tests as stress tests
# 输出配置
addopts =
-v
--tb=short
--strict-markers
--strict-config
--cov=entity
--cov=services
--cov-report=xml:coverage.xml
--cov-report=html:htmlcov
--cov-report=term-missing
--cov-branch
# 过滤警告
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
# 最小覆盖率要求
[tool:coverage:run]
source = entity,services
omit =
*/tests/*
*/test_*
*/__pycache__/*
*/venv/*
*/env/*
[tool:coverage:report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
class .*\bProtocol\):
@(abc\.)?abstractmethod