📝 新增完整项目文档、测试套件与构建配置
This commit is contained in:
49
tests/README.md
Normal file
49
tests/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# 测试
|
||||
|
||||
此目录包含 pptopic 库的测试文件。
|
||||
|
||||
## 运行测试
|
||||
|
||||
运行所有测试:
|
||||
|
||||
```bash
|
||||
pytest
|
||||
```
|
||||
|
||||
运行测试并生成覆盖率报告:
|
||||
|
||||
```bash
|
||||
pytest --cov=pptopic --cov-report=html
|
||||
```
|
||||
|
||||
运行特定测试文件:
|
||||
|
||||
```bash
|
||||
pytest tests/test_convert.py
|
||||
```
|
||||
|
||||
运行特定测试类:
|
||||
|
||||
```bash
|
||||
pytest tests/test_convert.py::TestConvertPPTClass
|
||||
```
|
||||
|
||||
运行特定测试函数:
|
||||
|
||||
```bash
|
||||
pytest tests/test_convert.py::TestConvertPPTClass::test_init_with_valid_file
|
||||
```
|
||||
|
||||
## 测试结构
|
||||
|
||||
- `test_convert.py` - `convertPPT` 类的测试
|
||||
- `test_longpic.py` - `PPT_longPic` 函数的测试
|
||||
- `test_optimization.py` - `imageOptimization` 函数的测试
|
||||
|
||||
## 测试标记
|
||||
|
||||
测试可以使用以下标记:
|
||||
|
||||
- `slow` - 慢速测试(可以使用 `-m "not slow"` 跳过)
|
||||
- `integration` - 集成测试
|
||||
- `unit` - 单元测试
|
||||
Reference in New Issue
Block a user