mirror of
https://github.com/Usagi-org/ai-goofish-monitor.git
synced 2025-11-25 03:15:07 +08:00
- 添加了完整的测试框架 (pytest) - 为所有主要模块添加了单元测试 - 添加了测试配置文件 (pyproject.toml) - 更新了 requirements.txt 以包含测试依赖 - 添加了测试指南 (tests/README.md) 这些测试涵盖了: - utils.py 模块的所有功能 - config.py 模块的配置加载和环境变量处理 - ai_handler.py 模块的AI处理和通知功能 - prompt_utils.py 模块的prompt生成和配置更新 - scraper.py 模块的核心爬虫功能 - 各主要脚本的入口点测试 测试使用了pytest和unittest.mock来模拟外部依赖,确保测试的独立性和可重复性。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: rainsfly <dingyufei615@users.noreply.github.com>
18 lines
380 B
TOML
18 lines
380 B
TOML
[tool.pytest.ini_options]
|
|
addopts = "-v --tb=short"
|
|
testpaths = ["tests"]
|
|
python_files = ["test_*.py"]
|
|
python_classes = ["Test*"]
|
|
python_functions = ["test_*"]
|
|
|
|
[tool.coverage.run]
|
|
source = ["src"]
|
|
|
|
[tool.coverage.report]
|
|
exclude_lines = [
|
|
"pragma: no cover",
|
|
"def __repr__",
|
|
"raise AssertionError",
|
|
"raise NotImplementedError",
|
|
"if __name__ == .__main__.:",
|
|
] |