allure-framework / allure-framework/allure-python
[Feature request] Make `StepContext` available in public API for annotations
- 主要言語
- Python
- スター
- 814
- フォーク
- 260
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
#### 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: ...
```
コントリビューションガイド
調査の方向性
まず StepContext の定義と _allure.py での使用箇所を読み、次に allure.py の公開エクスポートを確認します。サンプルラッパーが戻り値のアノテーションで StepContext を使用できるよう、allure.py から StepContext を利用可能にし、公開インポートが機能することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100