Skip to content

Commit

Permalink
Improved doc example for current_cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain MARIE committed May 31, 2021
1 parent 3538124 commit 09f78ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,14 @@ yields
}}
```
As you can see above, details are provided as `namedtuple`s. When a case itself is parametrized, its current parameter value(s) appear too (in the above example, `case_a` is parametrized with `nb`).
As you can see above, details are provided as `namedtuple`s. When a case itself is parametrized, its current parameter value(s) appear too (in the above example, `case_a` is parametrized with `nb`). This can be used to skip a test conditionally, for example:
```python
if data_fun is case_a and data_params['nb'] == 1:
pytest.skip("This specific case is skipped")
```
It can also be used to insert a debug breakpoint for a specific case.
To get more information on the case function, you can use `get_case_marks(func)`, `get_case_tags(func)`. You can also use `matches_tag_query(...)` to check if a case function matches some expectations either concerning its id or its tags. See [API reference](./api_reference.md#matches_tag_query).
Expand Down

0 comments on commit 09f78ff

Please sign in to comment.