You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api_reference.md
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,17 @@ In general, using `help(symbol)` is the recommended way to get the latest docume
8
8
9
9
A fixture containing [`get_current_cases(request)`](#get_current_cases).
10
10
11
-
This is a dictionary containing all case parameters for the currently active `pytest` item. For each test function argument parametrized using a [`@parametrize_with_case(<argname>, ...)`](#parametrize_with_cases) this dictionary contains an entry `{<argname>: (actual_id, case_function)}`. If several argnames are parametrized this way, a dedicated entry will be present for each argname.
11
+
This is a dictionary containing all case parameters for the currently active `pytest` item. For each test function argument parametrized using a [`@parametrize_with_case(<argname>, ...)`](#parametrize_with_cases) this dictionary contains an entry `{<argname>: (case_id, case_function, case_params)}`. If several argnames are parametrized this way, a dedicated entry will be present for each argname. The tuple is a `namedtuple` containing
12
+
13
+
- `id` a string containing the actual case id constructed by `@parametrize_with_cases`.
14
+
- `function` the original case function.
15
+
- `params` a dictionary, containing the parameters of the case, if itself is parametrized. Note that if the
16
+
case is parametrized with `@parametrize_with_cases`, the associated parameter value in the dictionary will also be
17
+
`(case_id, case_function, case_params)`.
12
18
13
-
If a fixture parametrized with cases is active, the dictionary will contain an entry `{<fixturename>: <dct>}` where `<dct>` is a dictionary `{<argname>: (actual_id, case_function)}`.
19
+
If a fixture parametrized with cases is active, the dictionary will contain an entry `{<fixturename>: <dct>}` where `<dct>` is a dictionary `{<argname>: (case_id, case_function, case_params)}`.
14
20
15
-
To get more information on a case function, you can use [`get_case_id(f)`](#get_case_id), [`get_case_marks(f)`](#get_case_marks), [`get_case_tags(f)`](#get_case_tags). You can also use [`matches_tag_query`](#matches_tag_query) to check if a case function matches some expectations either concerning its id
21
+
To get more information on a case function, you can use [`get_case_marks(f)`](#get_case_marks), [`get_case_tags(f)`](#get_case_tags). You can also use [`matches_tag_query`](#matches_tag_query) to check if a case function matches some expectations either concerning its id
16
22
or its tags. See [filters and tags documentation](https://smarie.github.io/python-pytest-cases/#filters-and-tags).
Returns a dictionary containing all case parameters for the currently active `pytest` item. You can either pass the `pytest` item (available in some hooks) or the `request` (available in hooks, and also directly as a fixture).
313
319
314
-
For each test function argument parametrized using a [`@parametrize_with_case(<argname>, ...)`](#parametrize_with_cases) this dictionary contains an entry `{<argname>: (actual_id, case_function)}`. If several argnames are parametrized this way, a dedicated entry will be present for each argname.
320
+
For each test function argument parametrized using a [`@parametrize_with_case(<argname>, ...)`](#parametrize_with_cases) this dictionary contains an entry `{<argname>: (case_id, case_function, case_params)}`. If several argnames are parametrized this way, a dedicated entry will be present for each argname. The tuple is a `namedtuple` containing
321
+
322
+
- `id` a string containing the actual case id constructed by `@parametrize_with_cases`.
323
+
- `function` the original case function.
324
+
- `params` a dictionary, containing the parameters of the case, if itself is parametrized. Note that if the
325
+
case is parametrized with `@parametrize_with_cases`, the associated parameter value in the dictionary will also be
326
+
`(case_id, case_function, case_params)`.
315
327
316
-
If a fixture parametrized with cases is active, the dictionary will contain an entry `{<fixturename>: <dct>}` where `<dct>` is a dictionary `{<argname>: (actual_id, case_function)}`.
328
+
If a fixture parametrized with cases is active, the dictionary will contain an entry `{<fixturename>: <dct>}` where `<dct>` is a dictionary `{<argname>: (case_id, case_function, case_params)}`.
317
329
318
330
To get more information on a case function, you can use [`get_case_id(f)`](#get_case_id), [`get_case_marks(f)`](#get_case_marks), [`get_case_tags(f)`](#get_case_tags). You can also use [`matches_tag_query`](#matches_tag_query) to check if a case function matches some expectations either concerning its id
319
331
or its tags. See [filters and tags documentation](https://smarie.github.io/python-pytest-cases/#filters-and-tags).
0 commit comments