Use ParameterSet to extract argnames from parametrize mark
This commit is contained in:
parent
c00fe960ba
commit
e36adbaadc
|
@ -1533,15 +1533,8 @@ class FixtureManager:
|
||||||
"""Generate new tests based on parametrized fixtures used by the given metafunc"""
|
"""Generate new tests based on parametrized fixtures used by the given metafunc"""
|
||||||
|
|
||||||
def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]:
|
def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]:
|
||||||
if "argnames" in mark.kwargs:
|
args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs)
|
||||||
argnames = mark.kwargs[
|
return args
|
||||||
"argnames"
|
|
||||||
] # type: Union[str, Tuple[str, ...], List[str]]
|
|
||||||
else:
|
|
||||||
argnames = mark.args[0]
|
|
||||||
if not isinstance(argnames, (tuple, list)):
|
|
||||||
argnames = [x.strip() for x in argnames.split(",") if x.strip()]
|
|
||||||
return argnames
|
|
||||||
|
|
||||||
for argname in metafunc.fixturenames:
|
for argname in metafunc.fixturenames:
|
||||||
# Get the FixtureDefs for the argname.
|
# Get the FixtureDefs for the argname.
|
||||||
|
|
Loading…
Reference in New Issue