Defensive fallback in case of kwargs not being present

This commit is contained in:
Leonard Lausen 2017-10-09 00:37:27 +09:00
parent 48b5c13f73
commit e89abe6a40
1 changed files with 2 additions and 1 deletions

View File

@ -1039,8 +1039,9 @@ class FixtureManager:
if fixturedef.params is not None:
parametrize_func = getattr(metafunc.function, 'parametrize', None)
func_params = getattr(parametrize_func, 'args', [[None]])
func_kwargs = getattr(parametrize_func, 'kwargs', {})
# skip directly parametrized arguments
if "argnames" in parametrize_func.kwargs:
if "argnames" in func_kwargs:
argnames = parametrize_func.kwargs["argnames"]
else:
argnames = func_params[0]