|
6 | 6 |
|
7 | 7 | [](https://smarie.github.io/python-pytest-cases/) [](https://pypi.python.org/pypi/pytest-cases/) [](https://pepy.tech/project/pytest-cases) [](https://pepy.tech/project/pytest-cases) [](https://github.com/smarie/python-pytest-cases/stargazers) |
8 | 8 |
|
9 | | -!!! success "New `fixture_union` and `@pytest_parametrize_plus` are there, [check them out](#fixture_union) !" |
| 9 | +!!! success "New `unpacking feature`, [check it out](#unpack_fixture-unpack_into) !" |
10 | 10 |
|
11 | 11 | !!! warning "Test execution order" |
12 | 12 | Installing pytest-cases now has effects on the order of `pytest` tests execution, even if you do not use its features. One positive side effect is that it fixed [pytest#5054](https://github.com/pytest-dev/pytest/issues/5054). But if you see less desirable ordering please [report it](https://github.com/smarie/python-pytest-cases/issues). |
@@ -214,6 +214,8 @@ This new commandline is a goodie to change the reordering: |
214 | 214 |
|
215 | 215 | `@pytest_fixture_plus` is similar to `pytest.fixture` but without its `param` and `ids` arguments. Instead, it is able to pick the parametrization from `@pytest.mark.parametrize` marks applied on fixtures. This makes it very intuitive for users to parametrize both their tests and fixtures. As a bonus, its `name` argument works even in old versions of pytest (which is not the case for `fixture`). |
216 | 216 |
|
| 217 | +Finally it now supports unpacking, see [unpacking feature](#unpack_fixture-unpack_into). |
| 218 | + |
217 | 219 | !!! note "`@pytest_fixture_plus` deprecation if/when `@pytest.fixture` supports `@pytest.mark.parametrize`" |
218 | 220 | The ability for pytest fixtures to support the `@pytest.mark.parametrize` annotation is a feature that clearly belongs to `pytest` scope, and has been [requested already](https://github.com/pytest-dev/pytest/issues/3960). It is therefore expected that `@pytest_fixture_plus` will be deprecated in favor of `@pytest_fixture` if/when the `pytest` team decides to add the proposed feature. As always, deprecation will happen slowly across versions (at least two minor, or one major version update) so as for users to have the time to update their code bases. |
219 | 221 |
|
@@ -348,6 +350,8 @@ This feature has been tested in very complex cases (several union fixtures, fixt |
348 | 350 | !!! note "fixture unions vs. cases" |
349 | 351 | If you're familiar with `pytest-cases` already, you might note `@cases_data` is not so different than a fixture union: we do a union of all case functions. If one day union fixtures are directly supported by `pytest`, we will probably refactor this lib to align all the concepts. |
350 | 352 |
|
| 353 | +Finally fixture unions now supports unpacking, see [unpacking feature](#unpack_fixture-unpack_into). |
| 354 | + |
351 | 355 | ### `@pytest_parametrize_plus` |
352 | 356 |
|
353 | 357 | `@pytest_parametrize_plus` is a replacement for `@pytest.mark.parametrize` that allows you to include references to fixtures in the parameter values. Simply use `fixture_ref(<fixture>)` in the parameter values, where `<fixture>` can be the fixture name or fixture function. |
|
0 commit comments