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 - 1.3.0 - More flexible case generators names + Minor dependency change

Published by smarie over 5 years ago

Cases generators can now support explicit name lists, and name generator callables, in addition to the name template strings. Fixed #24

Dependency to decorator has been dropped and replaced with makefun. Fixed #25.

See documentation page for details.

python-pytest-cases - 1.2.2 - fixed bug with marks on cases with pytest 3.3

Published by smarie over 5 years ago

Marks on cases are now also working with pytest 3.3. Fixed #23

Ids for marked tests are now better managed. A new function get_pytest_parametrize_args is now used to transform the list of cases obtained by get_all_cases(module), into the list of marked cases and ids required by @pytest.mark.parametrize. The doc has been updated to explain this for advanced users wishing to perform this step manually.

See documentation page for details.

python-pytest-cases - 1.2.1 - fixed id of test cases with marks

Published by smarie over 5 years ago

Id of test cases with marks was appearing as ParameterSet. Fixed it.

See documentation page for details.

Pytest marks such as @pytest.mark.skipif can now be used on case functions. As a consequence, get_all_cases is now the recommended function to use instead of extract_cases_from_module to perform manual collection. Indeed get_all_cases correctly prepares the resulting parameters list so that pytest sees the marks. Fixed #21

Fixed parametrization order when @pytest_fixture_plus is used with several @pytest.mark.parametrize. Fixed #22.

See documentation page for details.

python-pytest-cases - 1.1.1 - Improved generated fixture names for `@pytest_fixture_plus`

Published by smarie almost 6 years ago

When @pytest_fixture_plus is used on a function marked as parametrized, some fixtures are generated (one for each parameter). Generated fixture names now follow the pattern <fixturename>__<paramname>.
Fixed #20.

See documentation page for details.

python-pytest-cases - 1.1.0 - New `@pytest_fixture_plus`

Published by smarie almost 6 years ago

New decorator @pytest_fixture_plus allows to use several @pytest.mark.parametrize on a fixture. Therefore one can use multiple @cases_data decorators, too. Fixes #19.
Note: this is a temporary feature, that will be removed if/when pytest supports it.

See documentation page for details.

python-pytest-cases - 1.0.0 - `@cases_fixture` + pytest 2.x support

Published by smarie almost 6 years ago

Pytest 2.x is now supported. Fixes #14

New feature: @cases_fixture ! Now you can put your cases data retrieval in a fixture so that its duration does not enter into the test duration. This is particularly interesting if you use pytest-harvest to create benchmarks: you probably do not want the case data retrieval/parsing to be counted in the test duration, especially if you use caching on the case function to accelerate subsequent retrievals. Fixes #15

See documentation 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