Skip to content

Commit

Permalink
MNT: Simplify try/except/else block
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Markiewicz <[email protected]>
  • Loading branch information
DimitriPapadopoulos and effigies committed Sep 24, 2024
1 parent ce2de97 commit 9043c97
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions nibabel/cmdline/tests/test_roi.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,8 @@ def test_nib_roi_bad_slices(capsys, args, errmsg):
def test_entrypoint(capsys):
# Check that we handle missing args as expected
with mock.patch('sys.argv', ['nib-roi', '--help']):
try:
with pytest.raises(SystemExit):
main()
except SystemExit:
pass
else:
pytest.fail('argparse exits on --help. If changing to another parser, update test.')
captured = capsys.readouterr()
assert captured.out.startswith('usage: nib-roi')

Expand Down

0 comments on commit 9043c97

Please sign in to comment.