feat: Add coverage report generation and enhance testing framework
- 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.
This commit is contained in:
1 parent
ce4a332dc0
commit
539e580147
44 files changed
+11824
-9501
No files matched your search
+48
@@ -0,0 +1,48 @@
|
||||
[pytest]
|
||||
# pytest配置文件
|
||||
|
||||
# 测试发现模式
|
||||
python_files = test_*.py *_test.py
|
||||
python_classes = Test*
|
||||
python_functions = test_*
|
||||
|
||||
# 测试目录
|
||||
testpaths = tests
|
||||
|
||||
# 命令行选项
|
||||
addopts =
|
||||
-v
|
||||
--strict-markers
|
||||
--tb=short
|
||||
--cov=.
|
||||
--cov-report=term-missing
|
||||
-p no:warnings
|
||||
|
||||
# 标记定义
|
||||
markers =
|
||||
unit: 单元测试
|
||||
integration: 集成测试
|
||||
slow: 慢速测试(需要较长时间)
|
||||
requires_device: 需要真实设备(需要ADB连接)
|
||||
requires_gui: 需要GUI环境
|
||||
requires_network: 需要网络连接
|
||||
mock: 使用Mock的测试
|
||||
|
||||
# 日志配置
|
||||
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
|
||||
|
||||
# 超时设置(秒)
|
||||
timeout = 300
|
||||
timeout_method = thread
|
||||
|
||||
# 最小Python版本
|
||||
minversion = 7.4.0
|
||||
|
||||
# 忽略警告
|
||||
filterwarnings =
|
||||
ignore::DeprecationWarning
|
||||
ignore::PendingDeprecationWarning
|
||||
|
||||
Reference in new issue
Block a user