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
15 changes: 5 additions & 10 deletions src/_pytest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,9 +1484,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 @@ -1811,12 +1811,7 @@ def _warn_about_skipped_plugins(self) -> None:


def _assertion_supported() -> bool:
try:
assert False
except AssertionError:
return True
else:
return False # type: ignore[unreachable]
return __debug__


def create_terminal_writer(
Expand Down Expand Up @@ -1906,7 +1901,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