Separate test code from test cases in pytest.
BSD-3-CLAUSE License
Bot releases are visible (Hide)
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.
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.
Published by smarie over 5 years ago
Id of test cases with marks was appearing as ParameterSet
. Fixed it.
See documentation page for details.
Published by smarie over 5 years ago
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.
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.
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.
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.