Skip to content

Commit 349bfd9

Browse files
committed
config: make it clear only parse_setoption can raise PrintHelp
1 parent a32a012 commit 349bfd9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/_pytest/config/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,16 +1541,16 @@ def parse(self, args: list[str], addopts: bool = True) -> None:
15411541
args = self._parser.parse_setoption(
15421542
args, self.option, namespace=self.option
15431543
)
1544-
self.args, self.args_source = self._decide_args(
1545-
args=args,
1546-
pyargs=self.known_args_namespace.pyargs,
1547-
testpaths=self.getini("testpaths"),
1548-
invocation_dir=self.invocation_params.dir,
1549-
rootpath=self.rootpath,
1550-
warn=True,
1551-
)
15521544
except PrintHelp:
1553-
pass
1545+
return
1546+
self.args, self.args_source = self._decide_args(
1547+
args=args,
1548+
pyargs=self.known_args_namespace.pyargs,
1549+
testpaths=self.getini("testpaths"),
1550+
invocation_dir=self.invocation_params.dir,
1551+
rootpath=self.rootpath,
1552+
warn=True,
1553+
)
15541554

15551555
def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None:
15561556
"""Issue and handle a warning during the "configure" stage.

0 commit comments

Comments
 (0)