Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
)
Expand Down Expand Up @@ -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:
Expand Down