Pytest-cases

Latest version: v3.8.6

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

Scan your dependencies

Page 7 of 20

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)

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).

2.7.0

- `parametrize_with_cases` now explicitly supports all id customization methods (`ids`, `idgen` and `idstyle`) supported by `parametrize` (`ids`, `idgen` and `idstyle`). Updated documentation accordingly. Fixed [151](https://github.com/smarie/python-pytest-cases/issues/151)

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)

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)

2.4.0

- `is_lazy` is now part of public API, and `_LazyValue` now has a cache mechanism like `_LazyTuple`. Fixes [143](https://github.com/smarie/python-pytest-cases/issues/143)

- `parametrize`: custom `ids` are now correctly taken into account when a single `lazy_value`is used for a tuple of parameters. This issue could be seen also with `parametrize_with_cases`: `idgen` does not seem to be taken into account when cases are unpacked into a tuple. Fixes [144](https://github.com/smarie/python-pytest-cases/issues/144).

- Empty case ids are now replaced with `'<empty_case_id>'` to avoid ambiguous interpretation of test ids. Fixes [142](https://github.com/smarie/python-pytest-cases/issues/142).

Page 7 of 20

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.