allure-framework / allure-framework/allure-python
Improve context manager
- 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ả
#### I'm submitting a ...
- [x] feature request
#### What is the current behavior?
Context manager for `allure.step()` does not allow assigning a variable name, which would be useful.
#### What is the expected behavior?
I'd like it if this worked:
```py
with allure.step('foo') as s:
print(s.title)
```
I expected that to work because this does work:
```py
s = allure.step('foo')
print(s.title)
```
#### What is the motivation / use case for changing the behavior?
Having this named context manager would keep very simple code DRY.
#### Please tell us about your environment:
- Allure version: 🤷♂️ I'm just doing the code review, not sure how to determine this.
- Test framework: pytest@^8.2.2
- Allure adaptor: allure-pytest@^2.13.5
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu từ điểm vào của context manager allure.step() và tái hiện hai ví dụ sử dụng bằng pytest. Thay đổi được hoàn tất khi `with allure.step('foo') as s` cung cấp cùng giá trị `title` như phép gán trực tiếp; thêm hoặc cập nhật các test liên quan đến hành vi này.
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
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- 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
- 42/100