Skip to content

Commit

Permalink
Lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
kschwab committed Nov 9, 2024
1 parent c73c42e commit 84fb5c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_source_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2120,13 +2120,12 @@ class Settings(BaseModel):
in capsys.readouterr().err
)


with monkeypatch.context() as m:
m.setattr(sys, 'argv', ['example.py', '--help'])
with pytest.raises(SystemExit):
CliApp.run(Settings)
usage = (
"""usage: example.py [-h] [--circle-optional.radius float |
"""usage: example.py [-h] [--circle-optional.radius float |
--circle-optional.diameter float |
--circle-optional.perimeter float]
(--circle-required.radius float |
Expand All @@ -2138,7 +2137,8 @@ class Settings(BaseModel):
(--circle-required.radius float | --circle-required.diameter float | --circle-required.perimeter float)"""
)
assert (
capsys.readouterr().out == f"""{usage}
capsys.readouterr().out
== f"""{usage}
{ARGPARSE_OPTIONS_TEXT}:
-h, --help show this help message and exit
Expand All @@ -2159,7 +2159,7 @@ class Settings(BaseModel):
--circle-required.perimeter float
(default: 23)
"""
)
)


def test_cli_mutually_exclusive_group_exceptions():
Expand Down

0 comments on commit 84fb5c9

Please sign in to comment.