carpentries-incubator / carpentries-incubator/python-intermediate-development

Add information about additional helpful pytest features

Aperta
#372 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
ukaea-rse-team
Lingua principale
TeX
Stelle
63
Fork
77
Merge medio
20h 8m
PR unite (30g)
3

Descrizione

In the course of a run of the course at UKAEA, the following feedback was collected:

- Recommend adding `ids` argument to `pytest.parameterise`, e.g. else you can have a test `my_test[1-2-None]` which is not very informative.
- Explaining how to run one sub-test (encourage quotes for cross-shell compatibility - zsh doesnt like without):
```sh
pytest -k "my_test[iteration-name]"
```
- Mention other useful opts?
- `-s` stdout
- `-x` terminate on first fail
- `-v` show each test by name

@kzscisoft I believe it might have been you to add this? Anything further you might add?

The usual concern is adding more material to an already lengthy course. However, perhaps this could be added as an "Optional" exercise for learners that are a little bit ahead?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

L’issue non indica alcun file della lezione né alcun punto di ingresso dei test. Esamina prima il materiale esistente del corso su pytest e sulla parametrizzazione, quindi aggiungi la guida opzionale richiesta su ids, sulla selezione di un sottotest con -k tra virgolette e su -s/-x/-v; il lavoro è completo quando gli esempi sono corretti e rientrano nell’ambito del corso.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.