allure-framework / allure-framework/allure-python
Improve context manager
- Langage dominant
- Python
- Étoiles
- 814
- Forks
- 260
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
#### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par le point d’entrée du gestionnaire de contexte allure.step() et reproduisez les deux exemples d’utilisation avec pytest. La modification est terminée lorsque `with allure.step('foo') as s` expose la même valeur de `title` qu’une affectation directe ; ajoutez ou mettez à jour les tests pertinents concernant ce comportement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- testing
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100