Defensive fallback in case of kwargs not being present
This commit is contained in:
parent
48b5c13f73
commit
e89abe6a40
|
@ -1039,8 +1039,9 @@ class FixtureManager:
|
||||||
if fixturedef.params is not None:
|
if fixturedef.params is not None:
|
||||||
parametrize_func = getattr(metafunc.function, 'parametrize', None)
|
parametrize_func = getattr(metafunc.function, 'parametrize', None)
|
||||||
func_params = getattr(parametrize_func, 'args', [[None]])
|
func_params = getattr(parametrize_func, 'args', [[None]])
|
||||||
|
func_kwargs = getattr(parametrize_func, 'kwargs', {})
|
||||||
# skip directly parametrized arguments
|
# skip directly parametrized arguments
|
||||||
if "argnames" in parametrize_func.kwargs:
|
if "argnames" in func_kwargs:
|
||||||
argnames = parametrize_func.kwargs["argnames"]
|
argnames = parametrize_func.kwargs["argnames"]
|
||||||
else:
|
else:
|
||||||
argnames = func_params[0]
|
argnames = func_params[0]
|
||||||
|
|
Loading…
Reference in New Issue