jerry-git / jerry-git/pytest-split

Exception during test collection results in ZeroDivisionError

Đang mở
#4 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
325
Fork
56
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Reproduce the failure with `pytest --splits 3 --group 1`, then inspect `pytest_split/plugin.py` at `_calculate_suite_start_and_end_idx`, especially line 114. Confirm that a collection-time `ImportError` is being replaced by `ZeroDivisionError`; done means the original collection exception remains visible instead.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
testing-qa
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.