Skip to content

Releases: smarie/python-pytest-cases

3.0.0 - harmonization of ids and public API for cases info

16 Dec 15:45

Choose a tag to compare

  • Major refactoring of the way ids and marks are generated and customized in fixture_union, @parametrize and @parametrize_with_cases. Now idstyle has a consistent behaviour across the board, ids and idstyle can work together correctly, @parametrize_with_cases and @parametrize have much better default values for ids, and many others. See documentation for details. Fixed #154

  • New public API to manipulate information about a case function: copy_case_info, set_case_id, get_case_id, get_case_marks, get_case_tags, matches_tag_query, is_case_class, is_case_function. See API reference.

  • Fixed default behaviour of idgen in @parametrize: it only defaults to AUTO when no fixture_ref are used in the argvalues.

See documentation page for details.

2.7.2 - Bugfix with doctest

08 Dec 22:53

Choose a tag to compare

  • Fixed AttributeError: 'DoctestItem' object has no attribute '_request' when executing doctests. Fixes #156

See documentation page for details.

2.7.1 - `@pytest.mark.usefixtures` can be used on case functions

02 Dec 17:54

Choose a tag to compare

  • @pytest.mark.usefixtures can be now be used on case functions. Fixes #152.

See documentation page for details.

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

02 Dec 12:39

Choose a tag to compare

  • 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.

2.5.0 - case ids `glob` match improvements

28 Nov 15:36

Choose a tag to compare

  • Improved description for the glob argument in @parametrize_with_cases. Also made the implementation escape all regex special characters so that they can't be used. Finally a pattern should now match the entire case id (previously, a partial match would work if it was at the beginning of the string). One step towards #147

See documentation page for details.

2.4.0 - various fixes for test ids and lazy values

26 Nov 13:04

Choose a tag to compare

  • is_lazy is now part of public API, and _LazyValue now has a cache mechanism like _LazyTuple. Fixes #143

  • @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.

  • Empty case ids are now replaced with '<empty_case_id>' to avoid ambiguous interpretation of test ids. Fixes #142.

See documentation page for details.

2.3.0 - better `LazyValue` internal API

13 Oct 10:06

Choose a tag to compare

  • new clone(self, remove_int_base=False) API on LazyValue and LazyTupleItem instances. With this new API, on old pytest < 5.3, other plugins such as pytest-harvest can easily clone the contents from lazy values without having them inherit from int - which was a dirty hack used by pytest-cases to trick pytest to generate acceptable test ids in these old pytest versions. Also improved the LazyValue, LazyTuple and LazyTupleItem object model with equality and repr. Fixes pytest-harvest#43

See documentation page for details.

2.2.5 - Marks are now correctly propagated from Case class

02 Oct 21:21

Choose a tag to compare

  • Marks set on a case class are now propagated to cases in the class. So you can use for example pytest-pilot more easily ! Fixes #139

See documentation page for details.

2.2.4 - Fixes issue

01 Oct 16:49

Choose a tag to compare

  • Fixed "Created fixture names are not unique, please report" error when duplicate fixture reference is provided in a pytest.param. Fixes #138.

See documentation page for details.

2.2.3 - Fixed issue with pytest `3.X`

24 Sep 16:15

Choose a tag to compare

  • Fixed TypeError: _idval() got an unexpected keyword argument 'item' with pytest versions between 3.0.0 and 3.7.4. Fixed #136

See documentation page for details.