allure-framework / allure-framework/allure-python
Improve context manager
- 主要言語
- Python
- スター
- 814
- フォーク
- 260
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
#### 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
コントリビューションガイド
調査の方向性
allure.step() のコンテキストマネージャーのエントリポイントから開始し、2つの使用例を pytest で再現してください。`with allure.step('foo') as s` が直接代入と同じ `title` 値を公開すれば変更は完了です。この動作に関する関連テストを追加または更新してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- testing
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100