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 visible (Hide)

python-pytest-cases - 3.6.0 - `unpack_fixtures` in classes + `current_cases` improvements

Published by github-actions[bot] over 3 years ago

  • The current_cases fixture now contains case parameters if any. Fixes #214

  • The current_cases fixture entries are now instances of namedtuple.

  • New in_cls argument in unpack_fixtures so that it can be used inside classes. Fixes #201

  • Fixed minor issue where empty entries could be present in currentcases. Fixes #213

See documentation page for details.

python-pytest-cases - 3.5.2 - bugfix with the `currentcases` fixture

Published by github-actions[bot] over 3 years ago

  • Fixed issues where the currentcases fixture would not return the correct case function. Fixed #212

See documentation page for details.

python-pytest-cases - 3.5.1 - python 3.10 compatibility + improved error message

Published by github-actions[bot] over 3 years ago

  • Fixed error message related to misuse of fixture_ref. Fixes #209
  • Fixed import error with python 3.10. Fixes #207

See documentation page for details.

python-pytest-cases - 3.5.0 - New `current_cases` fixture and `get_current_cases` function + Fixes

Published by github-actions[bot] over 3 years ago

  • New: Users can now easily access the current cases for each parametrized argument thanks to the new current_cases fixture. A new helper function get_current_cases is also provided, for direct access from a hook. get_current_case_id becomes deprecated in favour of these two. Fixes #195

  • Bugfix: Fixed issue where the cache of a lazy_value used for a tuple of parameters (several argnames) was not considering the pytest context and thus was wrongly used across pytest nodes. Fixes #202

  • Improved error message when a fixture parametrized with several argnames as once is not able to unpack the parameter values received (non subscriptable object).

  • parametrize_plus and fixture_plus are now deprecated in favour of parametrize and fixture, as most users seem to have adopted these names without issues.

  • (internal) Replaced the "used" parameter with a dedicated singleton USED

See documentation page for details.

python-pytest-cases - 3.4.6 - Increased compatibility with other plugins

Published by github-actions[bot] over 3 years ago

  • LazyValue, LazyTuple and LazyTupleItem are now hashable. This increases compatibility with plugins hashing the parameter values, such as pytest-steps. See pytest-steps#41 . Fixes #199

See documentation page for details.

python-pytest-cases - 3.4.5 - Bugfix

Published by github-actions[bot] over 3 years ago

  • Fixed bug when a test module containing @parametrize_with_cases was executed outside of pytest, typically through its __main__. Fixes #198

See documentation page for details.

python-pytest-cases - 3.4.4 - Bugfix

Published by github-actions[bot] over 3 years ago

  • Fixed issue when @parametrize_with_cases was used on a fixture in a conftest.py. Fixes #196

See documentation page for details.

python-pytest-cases - 3.4.3 - Technical release - Zenodo

Published by github-actions[bot] over 3 years ago

Technical release to check that Zenodo metadata is now preserved.
Same as 3.4.2, 3.4.1 and 3.4.0.

See documentation page for details.

python-pytest-cases - 3.4.2 - Technical release - Zenodo

Published by github-actions[bot] over 3 years ago

Technical release to check that Zenodo metadata is now preserved.
Same as 3.4.1 and 3.4.0.

See documentation page for details.

python-pytest-cases - 3.4.1 - Technical release - Zenodo

Published by github-actions[bot] over 3 years ago

Technical release to check that Zenodo metadata is now preserved.

See documentation page for details.

python-pytest-cases - 3.4.0 - Goodbye v1 API + Support for unbound cases + Bugfix with marks + Fixtures in case files

Published by github-actions[bot] over 3 years ago

  • Legacy v1 API was dropped. Fixes #192

  • Unbound case functions in a class (e.g. Foo.bar) can now be directly passed to parametrize_with_cases without instantiating the class, e.g. parametrize_with_cases(cases=Foo.bar). Fixes #159

  • Fixed bug with concatenation of marks on cases. Fixes #191

  • Fixed an issue where a case transformed into a fixture, with the same name as the fixture it requires, would lead to a pytest fixture recursion.

  • Fixtures in case files can now be automatically imported using the experimental @parametrize_with_cases(import_fixtures=True). Fixes #193

See documentation page for details.

python-pytest-cases - 3.3.0 - Filter helpers, Current id getter, Support for `pytest-asyncio` and other plugins

Published by github-actions[bot] over 3 years ago

  • Migrated to Github Actions + nox for CI/CD.

  • New helper function get_current_case_id to get the current case id for a given pytest request or item. Fixes #189

  • Extended the support of fixture closure modifications to remove and insert(0, f). This in particular solves an issue with pytest-asyncio. Fixes #176

  • New filters module providing helper functions has_tag, id_has_prefix, id_has_suffix, id_match_regex to easily create custom filters for use in @parametrize_with_cases(filter=...). PR #184 by @saroad2, (thanks !).

See documentation page for details.

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.

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