2.6.0 - better cache for lazy values and support for infinite id generators
-
lazy_value
parameters are now cached by pytest node id only. So plugins can access the value without triggering an extra function call, but a new call is triggered for each pytest node, so as to prevent mutable object leakage across tests. Fixed #149 while ensuring no regression for #143. -
The
ids
argument ofparametrize
now accepts a (possibly infinite) generator of ids, e.g. (f"foo{i}" for i in itertools.count()
), just aspytest
does. This was not always the case, inparticular when parametrizing a@fixture
. Theids
arguments offixture_union
,param_fixture[s]
, etc. now also support this pattern. Fixed #148
See documentation page for details.