python-pytest-cases

Separate test code from test cases in pytest.

BSD-3-CLAUSE License

Downloads
658.7K
Stars
344
Committers
14

Bot releases are hidden (Show)

python-pytest-cases - 3.2.1 - `@fixture` Bugfix

Published by smarie over 3 years ago

  • Fixed fixture 'self' not found issue when @fixture was used to decorate a class method not explicitly depending on request. Fixed #182

See documentation page for details.

python-pytest-cases - 3.2.0 - Automatic `fixture_ref` + test ordering bugfix

Published by smarie almost 4 years ago

  • New: from version 3.2 on, if auto_refs=True (default), @parametrize will automatically detect fixture symbols in the list of argvalues, and will create fixture_refs automatically around them so that you don't need to. Fixes #177

  • Fixed ordering issue happening on linux targets when several @parametrize are used to decorate the same function. Fixes #180

See documentation page for details.

python-pytest-cases - 3.1.2 - Bugfixes with nesting and pytest-asyncio

Published by smarie almost 4 years ago

  • Now appending fixtures to the closure once it has been built is supported. This fixes an issue with pytest-asyncio. Fixes #176

  • Fixed issue when parametrize_with_cases was used on case functions themselves (nesting/recursion). This was due to a lack of support of the place_as magic pytest attribute. Fixes #179

  • Added a warning concerning usage of indirect in parametrize when fixture references are present. See #150

See documentation page for details.

python-pytest-cases - 3.1.1 - Bugfix with ids

Published by smarie almost 4 years ago

  • Fixed issue with Empty id marker leaking to test ids. Fixed #171

See documentation page for details.

python-pytest-cases - 3.1.0 - Improved cases collection

Published by smarie almost 4 years ago

  • @parametrize_with_cases now by default (cases=AUTO) looks for both file naming patterns test_<name>_cases.py and cases_<name>.py. Removed the AUTO2 constant. Fixed #140

  • Nested classes containing case functions are now officially supported (they were, but undocumented). Fixed #160

  • Case functions that are staticmethod and classmethod are now supported as well. Fixes #168

See documentation page for details.

python-pytest-cases - 3.0.0 - harmonization of ids and public API for cases info

Published by smarie almost 4 years ago

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

python-pytest-cases - 2.7.2 - Bugfix with doctest

Published by smarie almost 4 years ago

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

See documentation page for details.

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

Published by smarie almost 4 years ago

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

See documentation page for details.

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

Published by smarie almost 4 years ago

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

python-pytest-cases - 2.5.0 - case ids `glob` match improvements

Published by smarie almost 4 years ago

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

python-pytest-cases - 2.4.0 - various fixes for test ids and lazy values

Published by smarie almost 4 years ago

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

python-pytest-cases - 2.3.0 - better `LazyValue` internal API

Published by smarie about 4 years ago

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

python-pytest-cases - 2.2.5 - Marks are now correctly propagated from Case class

Published by smarie about 4 years ago

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

python-pytest-cases - 2.2.4 - Fixes issue

Published by smarie about 4 years ago

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

python-pytest-cases - 2.2.3 - Fixed issue with pytest `3.X`

Published by smarie about 4 years ago

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

python-pytest-cases - 2.2.2 - `@parametrize_with_cases` compatibility improvements

Published by smarie about 4 years ago

  • @parametrize_with_cases now supports that argnames is a list or tuple, just as @pytest.mark.parametrize does. PR #132, by @saroad2.

See documentation page for details.

python-pytest-cases - 2.2.1 - setup.py fix to enforce dependency version

Published by smarie about 4 years ago

  • Now enforcing usage of makefun 1.9.3 or above to avoid issue AttributeError: 'functools.partial' object has no attribute '__module__' mentioned in #128

See documentation page for details.

python-pytest-cases - 2.2.0 - Doc improvements + bugfix for cases requiring fixtures

Published by smarie about 4 years ago

  • Improved documentation to explain why @fixture should be used instead of @pytest.fixture. Fixed #125

  • Fixed ValueError: fixture is being applied more than once to the same function when two functions parametrized with the same cases were sitting in the same file. Improved robustness when cases require fixtures, in particular when parametrized test/fixture sits in a class or when several of them sit in a class/module. Fixed #126

See documentation page for details.

python-pytest-cases - 2.1.3 - Missing deprecation warning

Published by smarie about 4 years ago

  • Added missing deprecation warning on @cases_generator. Fixes #124.

  • Removed target and tags arguments of @cases_generator (deprecated api anyway) that were added by mistake in version 2.0.0 but never used.

See documentation page for details.

python-pytest-cases - 2.1.2 - Compatibility fix

Published by smarie about 4 years ago

  • Added support for pytest items without funcargs. Fixes interoperability with other pytest plugins such as pytest-black or pytest-flake8. Fixes #122

See documentation page for details.

Package Rankings
Top 2.23% on Pypi.org
Top 29.85% on Conda-forge.org
Badges
Extracted from project README
Python versions Build Status Tests Status Coverage Status codecov Flake8 Status Documentation PyPI Downloads Downloads per week GitHub stars DOI