You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error while decorating the test:
tests/feature/test_feature.py:91: in <module>
def test_features_to_ranked(snapshot, case):
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/common_pytest.py:840: in apply
return apply_decorator(test_or_fixture_func, container)
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:141: in _apply_parametrization
argvalues = get_parametrize_args(host_class_or_module, cases_funs, prefix=prefix, debug=debug, scope=scope)
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:307: in get_parametrize_args
return [c for _f in cases_funs for c in case_to_argvalues(host_class_or_module, _f, prefix, scope, debug)]
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:307: in <listcomp>
return [c for _f in cases_funs for c in case_to_argvalues(host_class_or_module, _f, prefix, scope, debug)]
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:370: in case_to_argvalues
fix_name, remaining_marks = get_or_create_case_fixture(case_id, case_fun, host_class_or_module,
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/case_parametrizer_new.py:477: in get_or_create_case_fixture
case_marks = get_case_marks(case_fun, concatenate_with_fun_marks=True)
../../../../../.cache/pypoetry/virtualenvs/emm-5s1w60K6-py3.8/lib/python3.8/site-packages/pytest_cases/case_funcs_new.py:187: in get_case_marks
return (_ci_marks + fun_marks) if _ci_marks else fun_marks
E TypeError: can only concatenate tuple (not "list") to tuple
The problem is here:
return (_ci_marks + fun_marks) if _ci_marks else fun_marks
simply wrapping fun_marks in tuple() would suffice, but I leave to you to decide if get_pytest_marks_on_function shouldn't better return a tuple in the first place.
The text was updated successfully, but these errors were encountered:
Yes apparently tuples are more efficient than lists in general, so I tried to have most functions manipulating marks return tuples. However since get_pytest_marks_on_function was used in many places I was a bit lazy here and left it as it was (returning a list). Thanks again!
I have a class case:
Using
parametrize_with_cases
like:I get the following error while decorating the test:
The problem is here:
where:
simply wrapping
fun_marks
intuple()
would suffice, but I leave to you to decide ifget_pytest_marks_on_function
shouldn't better return a tuple in the first place.The text was updated successfully, but these errors were encountered: