Skip to content

2.6.0 - better cache for lazy values and support for infinite id generators

Compare
Choose a tag to compare
@smarie smarie released this 02 Dec 12:39
· 244 commits to main since this release
  • 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 of parametrize now accepts a (possibly infinite) generator of ids, e.g. (f"foo{i}" for i in itertools.count()), just as pytest does. This was not always the case, inparticular when parametrizing a @fixture. The ids arguments of fixture_union, param_fixture[s], etc. now also support this pattern. Fixed #148

See documentation page for details.