Tags: smarie/python-pytest-cases
Tags
Fix ScopeMismatch with parametrized cases (#317) * tests: add test for issue #311 * fix: propagate scope in ...ParamAlternative * fix: mangle fixture name for conftest Fixtures that are to be injected in conftest.py will be available globally. If we do not include this information in the name of the autogenerated fixtures, we may risk causing a conflict if another test/case/conftest uses parametrization on the same tests. * fix: avoid conflict also if __init__.py exists When conftest is in a package rather than in a mere folder, its name is "fully qualified". Perhaps there would be no need to actually add the scope in this case, but better safe than sorry. * Do not pass on None as scope Make sure that the default scope always is "function" so as to avoid issues with pytest <= 6, which 'translates' the scope string kwarg into an index from a list. The list does not contain None. * More explicit None scope replacement As suggested by @smarie * Add note and example for conftest qualname * Test correctness of scopes As suggested by @smarie * Add changelog for #317 * Update docs/changelog.md --------- Co-authored-by: Sylvain Marié <sylvain.marie@schneider-electric.com>
Fixed `AttributeError` issue in `is_case_function` when an inspected … …symbol is a parametrized type hint without `__name__` (#294) * Fixed #292 by dropping the associated nox sessions * Fixed `AttributeError: __name__` issue in `is_case_function` when an inspected symbol comes from the typing package. Fixes #287 --------- Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
Fixed lazy value resolution issue when multiple consecutive lazy valu… …es are present in a @parametrize containing a fixture_ref (#275) * 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 * 3.6.13 changelog Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
PreviousNext