diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 7ff27643f10..3c8bf58d2d9 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -881,6 +881,8 @@ def _get_plugin_specs_as_list( if isinstance(specs, str): return specs.split(",") if specs else [] # Direct specification. + if type(specs) is list or type(specs) is tuple: + return list(specs) if isinstance(specs, collections.abc.Sequence): return list(specs) raise UsageError( @@ -1484,9 +1486,9 @@ def _get_unknown_ini_keys(self) -> List[str]: def parse(self, args: List[str], addopts: bool = True) -> None: # Parse given cmdline arguments into this config object. - assert ( - self.args == [] - ), "can only parse cmdline args at most once per Config object" + assert self.args == [], ( + "can only parse cmdline args at most once per Config object" + ) self.hook.pytest_addhooks.call_historic( kwargs=dict(pluginmanager=self.pluginmanager) ) @@ -1906,7 +1908,7 @@ def parse_warning_filter( parts.append("") action_, message, category_, module, lineno_ = (s.strip() for s in parts) try: - action: "warnings._ActionKind" = warnings._getaction(action_) # type: ignore[attr-defined] + action: warnings._ActionKind = warnings._getaction(action_) # type: ignore[attr-defined] except warnings._OptionError as e: raise UsageError(error_template.format(error=str(e))) from None try: