Skip to content

Commit e36adba

Browse files
committed
Use ParameterSet to extract argnames from parametrize mark
1 parent c00fe96 commit e36adba

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/_pytest/fixtures.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,15 +1533,8 @@ def pytest_generate_tests(self, metafunc: "Metafunc") -> None:
15331533
"""Generate new tests based on parametrized fixtures used by the given metafunc"""
15341534

15351535
def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]:
1536-
if "argnames" in mark.kwargs:
1537-
argnames = mark.kwargs[
1538-
"argnames"
1539-
] # type: Union[str, Tuple[str, ...], List[str]]
1540-
else:
1541-
argnames = mark.args[0]
1542-
if not isinstance(argnames, (tuple, list)):
1543-
argnames = [x.strip() for x in argnames.split(",") if x.strip()]
1544-
return argnames
1536+
args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs)
1537+
return args
15451538

15461539
for argname in metafunc.fixturenames:
15471540
# Get the FixtureDefs for the argname.

0 commit comments

Comments
 (0)