2.6.0 - better cache for lazy values and support for infinite id generators
-
lazy_valueparameters 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
idsargument ofparametrizenow accepts a (possibly infinite) generator of ids, e.g. (f"foo{i}" for i in itertools.count()), just aspytestdoes. This was not always the case, inparticular when parametrizing a@fixture. Theidsarguments offixture_union,param_fixture[s], etc. now also support this pattern. Fixed #148
See documentation page for details.