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

Add information about additional helpful pytest features

Open
#372 0 comments 0 reactions 0 assignees View on GitHub
ukaea-rse-team
Dominant language
TeX
Stars
63
Forks
77
Avg merge
20h 8m
Merged PRs (30d)
3

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.