allure-framework / allure-framework/allure-python

AssertionError vs Exception

Đang mở
#377 0 bình luận 8 reaction 0 người được giao Xem trên GitHub
task:new feature theme:pytest
Ngôn ngữ chính
Python
Star
814
Fork
260
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Currently Allure fails only on AssertionError and all Exception is treated as Broken.
This is a good feature but pytest reports them as Fail. This causes a bit of confusion on the report status.

An intermediate approach can be to allow for option on what constitutes a fail.
A suggestion is to provide an API where one can register baseclasses that can be as failures. This provides for better control to use with infrastructures that can have some common analysis to look for additional failures.

```
def get_status(exception):
if exception:
if isinstance(exception, AssertionError) or isinstance(exception, pytest.fail.Exception):
return Status.FAILED
elif isinstance(exception, pytest.skip.Exception):
return Status.SKIPPED
return Status.BROKEN
else:
return Status.PASSED
```

=> Something like...

```
def get_status(exception):
if exception:
for base_class in allure.FailExceptionList:
if isinstance(exception, base_class):
return Status.FAILED
elif isinstance(exception, pytest.skip.Exception):
return Status.SKIPPED
return Status.BROKEN
else:
return Status.PASSED
```

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

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue không nêu tên tệp triển khai hoặc các bài kiểm thử. Hãy bắt đầu bằng cách xác định đường dẫn hiện có từ exception đến status, được thể hiện bởi get_status và phần tích hợp pytest của nó; công việc được xem là hoàn tất khi cho phép các lớp cơ sở exception có thể cấu hình, đồng thời vẫn giữ nguyên việc xử lý các status failed, skipped, broken và passed.

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
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.