- Introduced a new `.coverage` file for tracking test coverage metrics. - Added `pytest.ini` configuration for streamlined testing setup, including coverage reporting and logging options. - Created `requirements-test.txt` to manage testing dependencies, ensuring a consistent testing environment. - Implemented a `run_tests.py` script to facilitate running tests with various options, including unit and integration tests. - Established a structured testing directory with unit and integration tests, enhancing code reliability and maintainability. - Updated documentation to reflect new testing procedures and configurations.
32 lines
585 B
Plaintext
32 lines
585 B
Plaintext
# 测试依赖包
|
|
# 安装命令: pip install -r requirements-test.txt
|
|
|
|
# 测试框架
|
|
pytest>=7.4.0
|
|
pytest-cov>=4.1.0
|
|
pytest-mock>=3.11.0
|
|
pytest-asyncio>=0.21.0
|
|
pytest-timeout>=2.1.0
|
|
pytest-xdist>=3.3.0 # 并行测试
|
|
|
|
# 代码质量检查(用于测试)
|
|
pytest-flake8>=1.1.0
|
|
pytest-pylint>=0.21.0
|
|
|
|
# 测试报告
|
|
pytest-html>=3.2.0
|
|
pytest-json-report>=1.5.0
|
|
|
|
# Mock和Fixtures
|
|
responses>=0.23.0 # HTTP请求mock
|
|
freezegun>=1.2.0 # 时间mock
|
|
faker>=19.0.0 # 测试数据生成
|
|
|
|
# 代码覆盖率
|
|
coverage>=7.3.0
|
|
|
|
# 类型检查(可选)
|
|
mypy>=1.5.0
|
|
types-requests>=2.31.0
|
|
|