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
@parametrize: custom ids are now correctly taken into account when a single lazy_valueis used for a tuple of parameters. This issue could be seen also with @parametrize_with_cases: idgen does not seem to be taken into account when cases are unpacked into a tuple. Fixes#144
docstring of `lazy_value` was clarified accordingly.
Copy file name to clipboardExpand all lines: docs/api_reference.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,8 @@ A reference to a value getter (an argvalue-providing callable), to be used in [`
315
315
316
316
A `lazy_value`is the same thing than a function-scoped fixture, except that the value getter function isnot a fixture and therefore can neither be parametrized nor depend on fixtures. It should have no mandatory argument.
317
317
318
+
By default the associated idis the name of the `valuegetter`callable, but a specific `id` can be provided otherwise. Note that this `id` does not take precedence over custom `ids`or`idgen` passed to `@parametrize`.
319
+
318
320
Note that a `lazy_value` can be included in a `pytest.param` without problem. In that case the id defined by `pytest.param` will take precedence over the one defined in`lazy_value`ifany. The marks, however, will all be kept wherever they are defined.
319
321
320
322
**Parameters**
@@ -323,6 +325,13 @@ Note that a `lazy_value` can be included in a `pytest.param` without problem. In
323
325
-`id`: an optional id. Otherwise `valuegetter.__name__` will be used by default
324
326
-`marks`: optional marks. `valuegetter` marks will also be preserved.
325
327
328
+
### `is_lazy`
329
+
330
+
```python
331
+
def is_lazy(argval) ->bool
332
+
```
333
+
334
+
Return `True`if`argval`is the outcome of processing a `lazy_value` through `@parametrize`. This encompasses parameters that are items of lazy tuples that are created when parametrizing several argnames with the same `lazy_value()`.
0 commit comments