allure-framework / allure-framework/allure-python

Improve context manager

Aperta
#826 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
task:new feature theme:core
Lingua principale
Python
Stelle
814
Fork
260
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

#### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal punto di ingresso del context manager allure.step() e riproduci i due esempi di utilizzo con pytest. La modifica è completata quando `with allure.step('foo') as s` espone lo stesso valore di `title` di un'assegnazione diretta; aggiungi o aggiorna i test pertinenti relativi a questo comportamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.