Separate test code from test cases in pytest.
BSD-3-CLAUSE License
Bot releases are hidden (Show)
Published by smarie over 5 years ago
Fixed param_fixtures
issue: all parameter values were identical to the last parameter of the tuple. Fixes #32.
See documentation page for details.
Published by smarie over 5 years ago
Following Sup3rGeo's proposal, introduced two helper methods to create simple "parameter fixtures". Fixes #31
See documentation page for details.
Published by smarie over 5 years ago
@pytest_fixture_plus
now correctly honors parameter id and marks overriden at single parameter level using pytest.param
. Fixed #30
See documentation page for details.
Published by smarie over 5 years ago
Fixed @pytest_fixture_plus
in case it is used with parametrize
and one parameter is itself customized using pytest.param
. Fixed #29.
See documentation page for details.
Published by smarie over 5 years ago
Major improvement of @pytest_fixture_plus
: instead of generating fixtures, it now correctly parametrizes the fixture. Skip/fail Marks are correctly copied too. Fixes #28
pytest_fixture_plus
does not accept the params
and ids
arguments any more, it only relies on parametrization marks.
See documentation page for details.
Published by smarie over 5 years ago
Fixed minor bug with parametrized @pytest_fixture_plus
: spaces are now correctly removed when multiple parameter names are provided in the same parametrize
call. Fixes #27
See documentation page for details.
Published by smarie over 5 years ago
Fixed bug with @pytest_fixture_plus
when used in parametrized mode. Fixes #26. Thanks Sup3rGeo!
See documentation page for details.
Published by smarie over 5 years ago
Now using decopatch
to create the decorators.
See documentation page for details.
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.