Recent Releases of pytest-cases
pytest-cases - 3.9.1 - support for python 3.14 and pytest 8.4
- Fixed
AttributeError: 'MiniMetafunc' object has no attribute '_params_directness'when a case function is parametrized or requires a fixtures, with pytest 8.4.0. Fixed #365 - Fixed
ValueError: The provided fixture function does not seem to be a fixturewith@fixture_refwith pytest 8.4.0. Fixed #364 - Dropped support for
python<3.9andpytest<6. Fixes #362 and fixes #186 - Fixed test suite for python 3.14, officializing the support for this version.
See documentation page for details.
- Python
Published by github-actions[bot] 9 months ago
pytest-cases - 3.9.0 - support for python 3.14 and pytest 8.6
- Fixed
AttributeError: 'MiniMetafunc' object has no attribute '_params_directness'when a case function is parametrized or requires a fixtures, with pytest 8.4.0. Fixed #365 - Fixed
ValueError: The provided fixture function does not seem to be a fixturewith@fixture_refwith pytest 8.4.0. Fixed #364 - Dropped support for
python<3.9andpytest<6. Fixes #362 and fixes #186 - Fixed test suite for python 3.14, officializing the support for this version.
See documentation page for details.
- Python
Published by github-actions[bot] 9 months ago
pytest-cases - 3.8.6 - compatibility fix
- Fixed issue with legacy python 2.7 and 3.5. Fixes #352.
See documentation page for details.
- Python
Published by github-actions[bot] over 1 year ago
pytest-cases - 3.8.5 - Suppressed annoying warning with pytest 8
- Fixed
PytestRemovedIn9Warning: Marks applied to fixtures have no effect. Fixed #337
See documentation page for details.
- Python
Published by github-actions[bot] almost 2 years ago
pytest-cases - 3.8.4 - Removed debug logs
- Reverted
DEBUGflag used for pytest 8 compatibility. Fixed #336
See documentation page for details.
- Python
Published by github-actions[bot] almost 2 years ago
pytest-cases - 3.8.3 - Support for `pytest` version 8
See documentation page for details.
- Python
Published by github-actions[bot] almost 2 years ago
pytest-cases - 3.8.2 - bugfixes and project improvements
- Fixed issue with upcoming
pytest 8.1release. PR #322 by @bluetech - Corrected API documentation (and comments) for the second file-name
pattern for
AUTO-cases lookup (cases_<name>.pyinstead ofcase_<name>.py). PR #320 by @michele-riva. - Fixed
AssertionErroronAUTOcases outside a 'normal' test module. Fixes #309. PR #320 by @michele-riva. - Improved error message in case of cases loading error in
@parametrize_with_caseswhen thecasesargument is a string refering to a relative or absolute module name. Fixedimport file mismatchwith pytest 8 when executing our own tests. Fixes #323. - Fixed failing tests in our builds due to the
event_loop_policyfixture that appeared inpytest-asyncio0.23. Fixes part of #321.
See documentation page for details.
- Python
Published by github-actions[bot] about 2 years ago
pytest-cases - 3.8.1 - bugfixes
- Fixed
ScopeMismatchwith parametrized cases in non-trivial test trees.scopeis now correctly handled for (i)fixturecases, and (ii) fixtures defined inconftest.pyfiles at any depth. Fixes #311. PR #317 by @michele-riva.
See documentation page for details.
- Python
Published by github-actions[bot] over 2 years ago
pytest-cases - 3.8.0 - async, generators and strict-markers
@fixtureand@parametrizeare now async and generator aware. Fixes #286. PR #301 by jgersti.- Fixed error with
pytest--strict-markers. Fixes #283. PR #300 by chrsmcgrr.
See documentation page for details.
- Python
Published by github-actions[bot] over 2 years ago
pytest-cases - 3.7.0 - python 3.12
- Added official support for Python 3.10, 3.11 and 3.12. Fixes #314
- Fixed
ModuleNotFoundError: distutilson Python 3.12 thanks topackaging. PR #312 by @jayqi. - Internal: switched to virtualenv backend.
See documentation page for details.
- Python
Published by github-actions[bot] over 2 years ago
pytest-cases - 3.6.14 - bugfixes
- Fixed
AttributeErrorissue inis_case_functionwhen an inspected symbol is a parametrized type hint without__name__. Fixes #287 - Fixed issue with
get_all_cases: default value forcaseswas wrong. Fixes #290
See documentation page for details.
- Python
Published by github-actions[bot] about 3 years ago
pytest-cases - 3.6.13 - bugfix
- Fixed issue where a lazy value (for example a case function) was not resolved before being injected in a parametrized function, and was therefore appearing as a
_LazyValueCaseParamValue. Fixed #274
See documentation page for details.
- Python
Published by github-actions[bot] almost 4 years ago
pytest-cases - 3.6.12 - type hint fix + enhanced compatibility with pytest plugins
- Improved compatibility with other
pytestplugins, in particularpytest-repeat, by supporting removal from fixture closure tree. Fixed #269. - Fixed type hint errors detected by
pyright. Fixed #270
See documentation page for details.
- Python
Published by github-actions[bot] almost 4 years ago
pytest-cases - 3.6.11 - bugfix for pytest-xdist and `get_all_cases` API improvement
get_all_casescan now be called withoutparametrization_target(defaulting to the caller module), and with an explicit module object. Fixed #258. PR #260 by @eddiebergman.- Fixed
AttributeError: module 'pytestcases' has no attribute 'CasesCollectionWarning' when runningpytest-xdistand at least one cases class is ignored because of `initornew_`. Fixed #249.
See documentation page for details.
- Python
Published by github-actions[bot] almost 4 years ago
pytest-cases - 3.6.10 - bugfix for pytest 7.1
- Fixed
ImportErrorwhen usingpytest 7.1. Fixed #264 and pytest-dev#9762.
See documentation page for details.
- Python
Published by github-actions[bot] almost 4 years ago
pytest-cases - 3.6.9 - Bugfix with pytest 7
See documentation page for details.
- Python
Published by github-actions[bot] about 4 years ago
pytest-cases - 3.6.8 - Bugfix: support for multiprocessing Pool
- Suppressed warnings in our own tests, to improve packaging maintenance. Fixed #248
- Fixed bug where setting
idsin@parametrizewithout setting explicitlyidgen=Nonewould raise aValueError. Fixed #238. - Fixed bug where case-holding class marks were not propagated to static methods and class methods. Fixed #246
- Fixed support for multiprocessing
Pool. Fixes #242
See documentation page for details.
- Python
Published by github-actions[bot] about 4 years ago
pytest-cases - 3.6.7 - Minor improvements and preparing for pytest 7
- Improved error message when a case function nested in a class has no
selfargument and is not static. Fixes #243 - Added support for the new Scopes enum in pytest 7. Fixed #241
- Fixed
__version__in development mode.
See documentation page for details.
- Python
Published by github-actions[bot] about 4 years ago
pytest-cases - 3.6.5 - Bugfix
- Fixed an issue where using keyword
argnamesin@pytest.mark.parametrizewould causeIndexError: tuple index out of rangein the tests collection phase. Fixed #234.
See documentation page for details.
- Python
Published by github-actions[bot] over 4 years ago
pytest-cases - 3.6.4 - Bugfix
- A case id can now be a reserved keyword without triggering any
SyntaxError, even if the case is transformed into a fixture. Fixes #230
See documentation page for details.
- Python
Published by github-actions[bot] over 4 years ago
pytest-cases - 3.6.3 - Bugfix
- Fixed an issue where a lazy value would not be resolved. This happens when the "auto-simplify fixture" happens in
@parametrize. Fixes #225
See documentation page for details.
- Python
Published by github-actions[bot] over 4 years ago
pytest-cases - 3.6.2 - Qualimetry
- Fixed most
flake8errors and updated documentation to usegenbadge. Fixes #223
See documentation page for details.
- Python
Published by github-actions[bot] over 4 years ago
pytest-cases - 3.6.1 - bugfix - parametrizing a class with `@parametrize`
- Fixed
ValueErrorwhen@parametrizeis used to parametrize a class. Also, added a more explicitTypeErrorwhen@parametrizeis used to parametrize a class and at least a fixture reference is present. Fixed #215.
See documentation page for details.
- Python
Published by github-actions[bot] over 4 years ago
pytest-cases - 3.6.0 - `unpack_fixtures` in classes + `current_cases` improvements
The
current_casesfixture now contains case parameters if any. Fixes #214The
current_casesfixture entries are now instances ofnamedtuple.New
in_clsargument inunpack_fixturesso that it can be used inside classes. Fixes #201Fixed minor issue where empty entries could be present in
currentcases. Fixes #213
See documentation page for details.
- Python
Published by github-actions[bot] over 4 years ago
pytest-cases - 3.5.2 - bugfix with the `currentcases` fixture
- Fixed issues where the
currentcasesfixture would not return the correct case function. Fixed #212
See documentation page for details.
- Python
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.5.1 - python 3.10 compatibility + improved error message
- 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
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.5.0 - New `current_cases` fixture and `get_current_cases` function + Fixes
New: Users can now easily access the current cases for each parametrized argument thanks to the new
current_casesfixture. A new helper functionget_current_casesis also provided, for direct access from a hook.get_current_case_idbecomes deprecated in favour of these two. Fixes #195Bugfix: Fixed issue where the cache of a
lazy_valueused for a tuple of parameters (severalargnames) was not considering the pytest context and thus was wrongly used across pytest nodes. Fixes #202Improved error message when a fixture parametrized with several argnames as once is not able to unpack the parameter values received (non subscriptable object).
parametrize_plusandfixture_plusare now deprecated in favour ofparametrizeandfixture, as most users seem to have adopted these names without issues.(internal) Replaced the
"used"parameter with a dedicated singletonUSED
See documentation page for details.
- Python
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.6 - Increased compatibility with other plugins
LazyValue,LazyTupleandLazyTupleItemare 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
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.5 - Bugfix
- Fixed bug when a test module containing
@parametrize_with_caseswas executed outside ofpytest, typically through its__main__. Fixes #198
See documentation page for details.
- Python
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.4 - Bugfix
- Fixed issue when
@parametrize_with_caseswas used on a fixture in aconftest.py. Fixes #196
See documentation page for details.
- Python
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.3 - Technical release - Zenodo
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
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.2 - Technical release - Zenodo
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
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.1 - Technical release - Zenodo
Technical release to check that Zenodo metadata is now preserved.
See documentation page for details.
- Python
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.4.0 - Goodbye v1 API + Support for unbound cases + Bugfix with marks + Fixtures in case files
Legacy v1 API was dropped. Fixes #192
Unbound case functions in a class (e.g.
Foo.bar) can now be directly passed toparametrize_with_caseswithout instantiating the class, e.g.parametrize_with_cases(cases=Foo.bar). Fixes #159Fixed 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
pytestfixture 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
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.3.0 - Filter helpers, Current id getter, Support for `pytest-asyncio` and other plugins
Migrated to Github Actions +
noxfor CI/CD.New helper function
get_current_case_idto get the current case id for a givenpytestrequest or item. Fixes #189Extended the support of fixture closure modifications to
removeandinsert(0, f). This in particular solves an issue withpytest-asyncio. Fixes #176New
filtersmodule providing helper functionshas_tag,id_has_prefix,id_has_suffix,id_match_regexto easily create custom filters for use in@parametrize_with_cases(filter=...). PR #184 by @saroad2, (thanks !).
See documentation page for details.
- Python
Published by github-actions[bot] almost 5 years ago
pytest-cases - 3.2.1 - `@fixture` Bugfix
- Fixed
fixture 'self' not foundissue when@fixturewas used to decorate a class method not explicitly depending onrequest. Fixed #182
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 3.2.0 - Automatic `fixture_ref` + test ordering bugfix
New: from version
3.2on, ifauto_refs=True(default),@parametrizewill automatically detect fixture symbols in the list of argvalues, and will createfixture_refs automatically around them so that you don't need to. Fixes #177Fixed ordering issue happening on linux targets when several
@parametrizeare used to decorate the same function. Fixes #180
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 3.1.2 - Bugfixes with nesting and pytest-asyncio
Now appending fixtures to the closure once it has been built is supported. This fixes an issue with
pytest-asyncio. Fixes #176Fixed issue when
parametrize_with_caseswas used on case functions themselves (nesting/recursion). This was due to a lack of support of theplace_asmagic pytest attribute. Fixes #179Added a warning concerning usage of indirect in parametrize when fixture references are present. See #150
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 3.1.1 - Bugfix with ids
- Fixed issue with Empty id marker leaking to test ids. Fixed #171
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 3.1.0 - Improved cases collection
@parametrize_with_casesnow by default (cases=AUTO) looks for both file naming patternstest_<name>_cases.pyandcases_<name>.py. Removed theAUTO2constant. Fixed #140Nested classes containing case functions are now officially supported (they were, but undocumented). Fixed #160
Case functions that are
staticmethodandclassmethodare now supported as well. Fixes #168
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 3.0.0 - harmonization of ids and public API for cases info
Major refactoring of the way ids and marks are generated and customized in
fixture_union,@parametrizeand@parametrize_with_cases. Nowidstylehas a consistent behaviour across the board,idsandidstylecan work together correctly,@parametrize_with_casesand@parametrizehave much better default values for ids, and many others. See documentation for details. Fixed #154New 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
idgenin@parametrize: it only defaults toAUTOwhen nofixture_refare used in the argvalues.
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 2.7.2 - Bugfix with doctest
- Fixed
AttributeError: 'DoctestItem' object has no attribute '_request'when executing doctests. Fixes #156
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 2.7.1 - `@pytest.mark.usefixtures` can be used on case functions
@pytest.mark.usefixturescan be now be used on case functions. Fixes #152.
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 2.6.0 - better cache for lazy values and support for infinite id generators
lazy_valueparameters 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
idsargument ofparametrizenow accepts a (possibly infinite) generator of ids, e.g. (f"foo{i}" for i in itertools.count()), just aspytestdoes. This was not always the case, inparticular when parametrizing a@fixture. Theidsarguments offixture_union,param_fixture[s], etc. now also support this pattern. Fixed #148
See documentation page for details.
- Python
Published by smarie about 5 years ago
pytest-cases - 2.5.0 - case ids `glob` match improvements
- Improved description for the
globargument 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
Published by smarie about 5 years ago
pytest-cases - 2.4.0 - various fixes for test ids and lazy values
is_lazyis now part of public API, and_LazyValuenow has a cache mechanism like_LazyTuple. Fixes #143@parametrize: customidsare now correctly taken into account when a singlelazy_valueis used for a tuple of parameters. This issue could be seen also with@parametrize_with_cases:idgendoes 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
Published by smarie over 5 years ago
pytest-cases - 2.3.0 - better `LazyValue` internal API
- new
clone(self, remove_int_base=False)API onLazyValueandLazyTupleIteminstances. With this new API, on oldpytest< 5.3, other plugins such aspytest-harvestcan easily clone the contents from lazy values without having them inherit fromint- which was a dirty hack used bypytest-casesto trickpytestto generate acceptable test ids in these old pytest versions. Also improved theLazyValue,LazyTupleandLazyTupleItemobject model with equality and repr. Fixes pytest-harvest#43
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.2.5 - Marks are now correctly propagated from Case class
- Marks set on a case class are now propagated to cases in the class. So you can use for example
pytest-pilotmore easily ! Fixes #139
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.2.4 - Fixes issue
- 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
Published by smarie over 5 years ago
pytest-cases - 2.2.3 - Fixed issue with pytest `3.X`
- Fixed
TypeError: _idval() got an unexpected keyword argument 'item'withpytestversions between 3.0.0 and 3.7.4. Fixed #136
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.2.2 - `@parametrize_with_cases` compatibility improvements
@parametrize_with_casesnow supports thatargnamesis a list or tuple, just as@pytest.mark.parametrizedoes. PR #132, by@saroad2.
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.2.1 - setup.py fix to enforce dependency version
- Now enforcing usage of
makefun1.9.3 or above to avoid issueAttributeError: 'functools.partial' object has no attribute '__module__'mentioned in #128
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.2.0 - Doc improvements + bugfix for cases requiring fixtures
Improved documentation to explain why
@fixtureshould be used instead of@pytest.fixture. Fixed #125Fixed
ValueError: fixture is being applied more than once to the same functionwhen 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
Published by smarie over 5 years ago
pytest-cases - 2.1.3 - Missing deprecation warning
Added missing deprecation warning on
@cases_generator. Fixes #124.Removed
targetandtagsarguments 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
Published by smarie over 5 years ago
pytest-cases - 2.1.2 - Compatibility fix
- Added support for pytest items without funcargs. Fixes interoperability with other pytest plugins such as
pytest-blackorpytest-flake8. Fixes #122
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.1.0 - Internal engine improvements + bugfixes
Fixed issue with @parametrize_with_cases when two cases with the same id and both requiring a fixture were to be created. Fixed #117.
Fixture closure engine refactoring:
When no fixture unions are present, the fixture closure is now identical to the default one in
pytest, to avoid issues originating from other plugins fiddling with the closure. Fixes #116New
SuperClosureclass representing the "list" facade on top of the fixture tree (instead ofFixtureClosureNode). In addition, this list facade now better handles editing the order of fixtures when possible. Fixes #111.Session and Module-scoped fixtures that are not used in all union alternatives are not any more torn town/setup across union alternatives. Fixes #120
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.0.4 - Bugfix
- Fixed
TypeErrorwith iterable argvalue in standard parametrize. Fixed #115.
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.0.3 - Bugfixes
Fixed wrong module string decomposition when passed to
casesargument in@parametrize_with_cases. Fixes #113Autouse fixtures are now correctly used. Fixed #114
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.0.2 - Better string representation for lazy values
Lazy values (so, test cases) now have a much nicer string representation ; in particular in pytest-harvest results tables. Fixes #112
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.0.1 - Better test ids and theory page
New documentation page concerning theory of fixture unions. Fixes #109
Using a
fixture_refin a new-style@parametrize(with**argsoridgen) now outputs a correct id. Fixes #110
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 2.0.0 - Less boilerplate & full `pytest` alignment
I am very pleased to announce this new version of pytest-cases, providing a lot of major improvements. Creating powerful and complex test suites have never been so easy and intuitive !
Below is a complete list of changes, but the user guide has also been updated accordingly so feel free to have a look to get a complete example-based walkthrough.
A/ More powerful and flexible cases collection
New @parametrize_with_cases decorator to replace @cases_data (deprecated).
- Aligned with
pytest:
- now `argnames` can contain several names, and the case functions are **automatically unpacked** into it. You don't need to perform a `case.get()` in the test anymore !
@parametrize_with_cases("a,b")
def test_foo(a, b):
# use a and b directly !
...
- cases are unpacked at test *setup* time, so *the clock does not run while the case is created* - in case you use `pytest-harvest` to collect the timings.
- `@parametrize_with_cases` can be used on test functions *as well as fixture functions* (it was already the case in v1)
- Easier to configure:
- the decorator now has a single `cases` argument to indicate the cases, wherever they come from (no `module` argument anymore)
- default (`cases=AUTO`) *automatically looks for cases in the associated case module* named `test_xxx_cases.py`. Users can easily switch to alternate pattern `cases_xxx.py` with `cases=AUTO2`. Fixes [#91](https://github.com/smarie/python-pytest-cases/issues/91).
- **cases can sit inside a class**, like [what you're used to do with `pytest`](https://docs.pytest.org/en/stable/getting-started.html#group-multiple-tests-in-a-class). This additional style makes it much more convenient to organize cases and associated them with tests, when cases sit in the same file than the tests. Fixes [#93](https://github.com/smarie/python-pytest-cases/issues/93).
- an explicit sequence can be provided, *it can mix all kind of sources*: functions, classes, modules, and *module names as strings* (even relative ones!).
@parametrize_with_cases("a", cases=(CasesClass, '.my_extra_cases'))
def test_foo(a):
...
- More powerful API for filtering:
- a new `prefix` argument (default `case_`) can be used to define case functions for various type of parameters: welcome `user_<id>`, `data_<id>`, `algo_<id>`, `model_<id>` ! Fixes [#108](https://github.com/smarie/python-pytest-cases/issues/108)
- a new `glob` argument receiving a glob-like string can be used to further filter cases based on their names. For example you can distinguish `*_success` from `*_failure` case ids, so as to dispatch them to the appropriate positive or negative test. Fixes [#108](https://github.com/smarie/python-pytest-cases/issues/108)
- finally you can still use `has_tag` and/or provide a `filter` callable, but now the callable will receive the case function, and this case function has a `f._pytestcase` attribute containing the id, tags and marks - it is therefore much easier to implement custom filtering.
B/ Easier-to-define case functions
Case functions can start with different prefixes to denote different kind of data: e.g.
data_<id>,user_<id>,model_<id>, etc.Case functions can now be parametrized with
@parametrizeor@pytest.mark.parametrize, just as in pytest ! This includes the ability to putpytestmarks on the whole case, or on some specific parameter values usingpytest.param.@cases_generatoris therefore now deprecated but its alternate style for ids and arguments definition was preserved in@parametrize, see below.Now case functions can require fixtures ! In that case they will be transformed into fixtures and injected as
fixture_refin the parametrization. Fixes #56.New single optional
@case(id=None, tags=(), marks=())decorator to replace@case_nameand@case_tags(deprecated): a single simple way to customize all aspects of a case function. Also,@test_targetcompletely disappears from the picture as it was just a tag like others - this could be misleading.
C/ Misc / pytest goodies
New aliases for readability:
@fixturefor@fixture_plus, and@parametrizefor@parametrize_plus(both aliases will coexist with the old names). Fixes #107.@parametrizewas improved in order to support the alternate parametrization mode that was previously offered by@cases_generator, see api reference. That way, users will be able to choose the style of their choice. Fixes #57 and #106.@parametrizenow raises an explicit error message when the user makes a mistake with the argnames. Fixes #105.More readable error messages in
@parametrizewhenlazy_valuedoes not return the same number of argvalues than expected from the argnames.Any error message associated to a
lazy_valuefunction call is not caught and hidden anymore but is emitted to the user, for easier debugging.Fixed issue with
lazy_valuewhen a single mark is passed in the constructor.lazy_valueused as a tuple for several arguments now have a correct id generated even in old pytest version 2.New pytest goodie
assert_exceptionthat can be used as a context manager. Fixes #104.
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 1.17.0 - `lazy_value` improvements + annoying warnings suppression
lazy_valueare now resolved at pytestsetupstage, not pytestcallstage. This is important for execution time recorded in the reports (see alsopytest-harvestplugin). Fixes #102A function used as a
lazy_valuecan now be marked with pytest marks. Fixes #99A
lazy_valuenow has a nicer id when it is a partial. Fixes #97Removed annoying
PytestUnknownMarkWarningwarning message when a mark was used on a case. Fixes #100
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 1.16.0 - New `lazy_value` for parameters
- New marker
lazy_valueforparametrize_plus. Fixes #92
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 1.15.0 - better `parametrize_plus` and smaller dependencies
Better support for
pytest.paraminparametrize_plusand also infixture_unionandfixture_param[s]. Improved corresponding ids. Fixed #79 and #86New
@ignore_unuseddecorator to protect a fixture function from the "NOT_USED" case happening when the fixture is used in a fixture union.Removed
six,wraptandenum34dependencies(Internal) submodules reorganization for readability
(Internal) suppressed a lot of code quality warnings
See documentation page for details.
- Python
Published by smarie over 5 years ago
pytest-cases - 1.14.0 - bugfixes and hook feature
Fixed
idsprecedence order when usingpytest.mark.parametrizein afixture_plus. Fixed #87Fixed issue with
fixture_unionwhen using the same fixture twice in it. Fixes #85Added the possibility to pass a
hookfunction in all API where fixtures are created behind the scenes, so as to ease debugging and/or save fixtures (withstored_fixturefrom pytest harvest). Fixes #83Fixture closures now support reordering when no unions are present. This suppressed the annoying warning "WARNING the new order is not taken into account !!" when it was not relevant. Fixes #81
See documentation page for details.
- Python
Published by smarie almost 6 years ago
pytest-cases - 1.13.1 - packaging improvements
- packaging improvements: set the "universal wheel" flag to 1, and cleaned up the
setup.py. In particular removed dependency tosixfor setup and addedpy.typedfile. Fixes #78
See documentation page for details.
- Python
Published by smarie almost 6 years ago
pytest-cases - 1.13.0 - `@cases_generator` default `names`
@cases_generator now has a default value for the names template, based on the parameters. Fixes #77.
See documentation page for details.
- Python
Published by smarie almost 6 years ago
pytest-cases - 1.12.4 - Bugfix
Fixed ValueError when a product of unions was used on a test node, for example when two parametrize_plus using fixture_refs were used on the same fixture or test function. Fixed #76
See documentation page for details.
- Python
Published by smarie almost 6 years ago
pytest-cases - 1.12.3 - Improved error messages
Improved error message when something that is not a fixture is used in unpack_fixture or fixture_union. Fixed #75
See documentation page for details.
- Python
Published by smarie almost 6 years ago
pytest-cases - 1.12.2 - Warning fix
Fixed deprecation warning #74
See documentation page for details.
- Python
Published by smarie about 6 years ago
pytest-cases - 1.12.1 - Bugfixes
Now using module name and not file path to detect symbols in cases files that are imported from elsewhere and not created locally. Indeed that was causing problems on some ^platforms where a
.pyccache file is created. Fixes #72Fixed
PluginValidationErrorwhenpytest_fixture_plusorpytest_parametrize_pluswere used in aconftest.pyfile. Fixes #71. According to discussion in pytest#6475,pytest_fixture_plusandpytest_parametrize_plusare now renamed tofixture_plusandparametrize_plusin order for pytest (pluggy) not to think they are hooks. Old aliases will stay around for a few versions, with a deprecation warning.
See documentation page for details.
- Python
Published by smarie about 6 years ago
pytest-cases - 1.12.0 - better test ids for parametrized tests with fixture refs + bugfix
Improved test ids for the cases where
fixture_refis used in the parameters list in@pytest_parametrize_plus. Fixed #69. Thankslast-partizanfor the suggestion !Fixed
TypeError: got an unexpected keyword argument 'indirect'withpytest5+. Fixed #70.
See documentation page for details.
- Python
Published by smarie about 6 years ago
pytest-cases - 1.11.9 - bugfix
FixtureClosureNode is now able to properly handle ignore_args, and now supports that plugins append fixtures to the closure, such as pytest-asyncio. Added corresponding tests. Fixes #68
See documentation page for details.
- Python
Published by smarie about 6 years ago
pytest-cases - 1.11.8 - bugfix
Fixed KeyError issue happening when a fixture is not found. Now users will see the "normal" error message from pytest ("fixture <name> not found"). Fixed #67.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.7 - bugfix
Fixed ValueError issue happening with indirectly parametrized fixtures. Fixed #64.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.6 - pyproject.toml
raddessi added a pyproject.toml - thanks! Fixed #65.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.5 - bugfix
pytest_parametrize_plus was not working correctly with test classes, leading to fixture 'self' not found. Fixed #63.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.4 - python 2 bugfix
Fixed issue happening with @pytest.mark.parametrize with python 2. Fixed #62.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.3 - minor improvements
Better error message when users use THIS_MODULE in cases= instead of module=.
Added __version__ package-level attribute.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.2 - Increased tolerance to other plugins + bugfix
Now when other plugins try to manipulate the fixture closure, warning messages are emitted but no error is raised. Fixed #55.
Also fixed issue #58 happening with doctest.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.1 - Added `six` dependency explicitly
It was missing from setup.py.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.11.0 - `fixture_ref` can now be used inside tuples, leading to cross-products
Fixes #47.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.10.1 - Bugfix
Fixed #52.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.10.0 - New feature: fixtures unpacking
You can now unpack a fixture iterable into several individual fixtures using unpack_fixture or using @pytest_fixture_plus(unpack_into=<names>). This is also available in union_fixture(unpack_into=<names>). Fixed #50 and #51.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.9.3 - Bugfix
Fixed issues when parametrize argnames contains a list. This fixed #49
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.9.2 - Bugfix with pytest 3.7
Fixed #48.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.9.1 - Bugfix
Fixed #48.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.9.0 - New `--with-reorder` commandline option
New commandline option '--with-reorder' to change the reordering startegy currently in application. Fixes #45.
The --with-reorder "skip" mode was not working correctly in presence of marks, fixed it. Fixed #46.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.8.1 - BugFixes
Ids should not be used when setting a NOT_USED parametrization. Fixes #43
Fixed issue with ordering and setup/teardown for higher-level scope fixtures (session and module scopes) when using union fixtures. Fixes #44
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.8.0 - Better ids for fixture unions
New:
fixture_unionnow accept a non-Nonevalue forids. It also has a newidstyleargument allowing users to change the style of ids used. Finallypytest_parametrize_plusrelies on thisidsargument to set a more readable list of ids for the created union. Fixes #41.
Misc:
- Added non-regression test for fixture order. It passes already for all recent pytest versions (after 3.3). Fixes #42
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.7.0 - New `@pytest_parametrize_plus` allowing fixture references to be used in parameter values
New decorator @pytest_parametrize_plus able to handle the case where a fixture_ref(<fixture_name>) is present in the parameter values list. This decorator can be applied both on test functions and fixtures (if they are decorated with @pytest_fixture_plus). Fixes #40
Major refactoring of the "union fixtures" mechanism.
- The
NOT_USEDstatus is now correctly propagated between dependent fixtures. This should fix a few cases where user fixtures were setup/teardown while not used in the current test node. - Empty fixture unions are not permitted anymore.
- The way unions are handled in test parametrization was redesigned. The new design is based on a two-steps approach: first build the fixture closure for each node as a tree (and not a list as in
pytest), and then apply parametrization intelligently based on this tree structure. This fixes several unintuitive behaviours that were happening with unions.
Note: interestingly this also fixes pytest#5054.
See documentation page for details.
- Python
Published by smarie over 6 years ago
pytest-cases - 1.6.3 - Minor exception enhancement
Improved the error message when the name template is wrong in @cases_generator. Fixes #39.
See documentation page for details.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.6.2 - bug fixes
fixture_union:
Changed the repr of
NOT_USEDtopytest_cases.NOT_USED.@pytest_fixture_plusnow correctly handles theNOT_USEDwhen fixtures in the union do not contain any parameter. Fixes #38.
param_fixtures:
param_fixturesnow delegates toparam_fixturewhen a single parameter name is provided. This is more consistent. Fixed #36.param_fixture[s]now support all arguments fromfixture(scopeandautousein particular).
See documentation page for details.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.6.1 - `@pytest_fixture_plus` improvement to handle `NOT_USED` cases
Fixed issue where fixtures get called with NOT_USED as a parameter when using a fixture_union. This issue is actually only fixed in @pytest_fixture_plus, if you use @pytest.fixture you have to handle it manually. Fixes #37
See documentation page for details.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.6.0 - `fixture_union` and `param_fixture[s]` bugfix
New fixture_union method to create a fixture that is the union/combination of other fixtures. This is an attempt to solve this pytest proposal.
Also, param_fixture and param_fixtures can now be used without necessarily storing the return value into a variable: they will automatically register the created fixtures in the calling module.
Finally, fixed a bug with param_fixtures when called to create a fixture for a single parameter.
See documentation page for details.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.5.1 - `param_fixtures` bugfix
Fixed param_fixtures issue: all parameter values were identical to the last parameter of the tuple. Fixes #32.
See documentation page for details.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.5.0 - new helpers `param_fixture` and `param_fixtures`
Following Sup3rGeo's proposal, introduced two helper methods to create simple "parameter fixtures". Fixes #31
See documentation page for details.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.4.2 - parametrized `@pytest_fixture_plus` minor bug fix
@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.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.4.1 - parametrized `@pytest_fixture_plus` minor bug fix
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.
- Python
Published by smarie almost 7 years ago
pytest-cases - 1.4.0 - `@pytest_fixture_plus` major improvement
Major improvement of
@pytest_fixture_plus: instead of generating fixtures, it now correctly parametrizes the fixture. Skip/fail Marks are correctly copied too. Fixes #28pytest_fixture_plusdoes not accept theparamsandidsarguments any more, it only relies on parametrization marks.
See documentation page for details.
- Python
Published by smarie almost 7 years ago