allure-framework / allure-framework/allure-python
[Feature request] Make `StepContext` available in public API for annotations
- 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?
```python
def allure_step__foo(content: str):
return allure.step(content)
```
Annotating return type of such function is not possible, because `allure.step` returns internal `StepContext` (under `_allure.py`)
#### What is the expected behavior?
Make `StepContext` available in `allure.py`
#### What is the motivation / use case for changing the behavior?
Adding `StepContext` to public API will allow to annotate return type of `allure_step__foo` in a nice and simple way via:
```python
def allure_step__foo(content: str) -> StepContext: ...
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc định nghĩa StepContext và cách sử dụng nó trong _allure.py, sau đó kiểm tra các export công khai trong allure.py. Cung cấp StepContext từ allure.py để wrapper ví dụ có thể sử dụng nó trong annotation giá trị trả về, và xác minh rằng import công khai hoạt động.
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
- api
- Loại issue
- Tính năng
- Độ 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
- 35/100