allure-framework / allure-framework/allure-python
[Feature request] Make `StepContext` available in public API for annotations
- Dominant language
- Python
- Stars
- 814
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
#### 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: ...
```
Contributor guide
Research direction
Start by reading the StepContext definition and its use in _allure.py, then inspect the public exports in allure.py. Make StepContext available from allure.py so the example wrapper can use it in a return annotation, and verify that the public import works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100