From e36adbaadc4f299efe195b16e5be686ab80cc2a4 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Sep 2020 14:37:20 -0300 Subject: [PATCH] Use ParameterSet to extract argnames from parametrize mark --- src/_pytest/fixtures.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index f0e02b8b9..44f05d28f 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1533,15 +1533,8 @@ class FixtureManager: """Generate new tests based on parametrized fixtures used by the given metafunc""" def get_parametrize_mark_argnames(mark: Mark) -> Sequence[str]: - if "argnames" in mark.kwargs: - argnames = mark.kwargs[ - "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 + args, _ = ParameterSet._parse_parametrize_args(*mark.args, **mark.kwargs) + return args for argname in metafunc.fixturenames: # Get the FixtureDefs for the argname.