Fix pytest.parametrize when argnames are specified as kwarg
This commit is contained in:
		
							parent
							
								
									761d552814
								
							
						
					
					
						commit
						c24ffa3b4c
					
				|  | @ -1037,9 +1037,13 @@ class FixtureManager: | |||
|             if faclist: | ||||
|                 fixturedef = faclist[-1] | ||||
|                 if fixturedef.params is not None: | ||||
|                     func_params = getattr(getattr(metafunc.function, 'parametrize', None), 'args', [[None]]) | ||||
|                     parametrize_func = getattr(metafunc.function, 'parametrize', None) | ||||
|                     func_params = getattr(parametrize_func, 'args', [[None]]) | ||||
|                     # skip directly parametrized arguments | ||||
|                     argnames = func_params[0] | ||||
|                     if "argnames" in parametrize_func.kwargs: | ||||
|                         argnames = parametrize_func.kwargs["argnames"] | ||||
|                     else: | ||||
|                         argnames = func_params[0] | ||||
|                     if not isinstance(argnames, (tuple, list)): | ||||
|                         argnames = [x.strip() for x in argnames.split(",") if x.strip()] | ||||
|                     if argname not in func_params and argname not in argnames: | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue