Pytest-cases

Latest version: v3.8.5

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 18

3.1.0

- `parametrize_with_cases` now by default (`cases=AUTO`) looks for both file naming patterns `test_<name>_cases.py` and `cases_<name>.py`. Removed the `AUTO2` constant. Fixed [140](https://github.com/smarie/python-pytest-cases/issues/140)

- Nested classes containing case functions are now officially supported (they were, but undocumented). Fixed [160](https://github.com/smarie/python-pytest-cases/issues/160)

- Case functions that are `staticmethod` and `classmethod` are now supported as well. Fixes [168](https://github.com/smarie/python-pytest-cases/issues/168)

See [documentation page](https://smarie.github.io/python-pytest-cases/changelog/) for details.

3.0.0

- Major refactoring of the way ids and marks are generated and customized in `fixture_union`, `parametrize` and `parametrize_with_cases`. Now `idstyle` has a consistent behaviour across the board, `ids` and `idstyle` can work together correctly, `parametrize_with_cases` and `parametrize` have much better default values for ids, and many others. See [documentation](./index.md) for details. Fixed [154](https://github.com/smarie/python-pytest-cases/issues/154)

- New 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](./api_reference.md).

- Fixed default behaviour of `idgen` in `parametrize`: it only defaults to `AUTO` when no `fixture_ref` are used in the argvalues.

See [documentation page](https://smarie.github.io/python-pytest-cases/changelog/) for details.

2.7.2

- Fixed `AttributeError: 'DoctestItem' object has no attribute '_request'` when executing doctests. Fixes [156](https://github.com/smarie/python-pytest-cases/issues/156)

See [documentation page](https://smarie.github.io/python-pytest-cases/changelog/) for details.

2.7.1

- `pytest.mark.usefixtures` can be now be used on case functions. Fixes [152](https://github.com/smarie/python-pytest-cases/issues/152).

See [documentation page](https://smarie.github.io/python-pytest-cases/changelog/) for details.

2.6.0

- `lazy_value` parameters 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](https://github.com/smarie/python-pytest-cases/issues/149) while ensuring no regression for [#143](https://github.com/smarie/python-pytest-cases/issues/143).

- The `ids` argument of `parametrize` now accepts a (possibly infinite) generator of ids, e.g. (`f"foo{i}" for i in itertools.count()`), just as `pytest` does. This was not always the case, inparticular when parametrizing a `fixture`. The `ids` arguments of `fixture_union`, `param_fixture[s]`, etc. now also support this pattern. Fixed [148](https://github.com/smarie/python-pytest-cases/issues/148)

See [documentation page](https://smarie.github.io/python-pytest-cases/changelog/) for details.

2.5.0

- Improved description for the `glob` argument 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](https://github.com/smarie/python-pytest-cases/issues/147)

See [documentation page](https://smarie.github.io/python-pytest-cases/changelog/) for details.

Page 7 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.