jerry-git / jerry-git/pytest-split
Exception during test collection results in ZeroDivisionError
未关闭
bug
- 主要语言
- Python
- 星标
- 325
- 派生
- 56
- PR 合并指标
- 30 天内没有已合并 PR
描述
In short, this:
`pytest --splits 3 --group 1`
results in this
```
File "/home/user/.venv/lib/python3.8/site-packages/pytest_split/plugin.py", line 114, in _calculate_suite_start_and_end_idx
avg_duration_per_test = sum(stored_durations.values()) / len(stored_durations)
ZeroDivisionError: division by zero
```
if there's e.g. some `ImportError` during test collection.
The ZeroDivisionError hides the original exception.
贡献指南
这个仓库没有索引到贡献指南
调研方向
使用 `pytest --splits 3 --group 1` 重现失败,然后检查 `pytest_split/plugin.py` 中的 `_calculate_suite_start_and_end_idx`,尤其是第 114 行。确认 collection 时的 `ImportError` 正被替换为 `ZeroDivisionError`;完成标准是原始的 collection 异常仍然可见,而不是被替换。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- testing-qa
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 48/100