Skip to content

Commit cc8cd2d

Browse files
committed
refactor(tests): use idiomatic pytest.raises instead of try-except for SystemExit
1 parent fe5c56a commit cc8cd2d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

scripts/version_scanner/tests/unit/test_version_scanner.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,8 @@ def test_main_loads_ignore_from_script_dir(mock_scan, mock_load_ignore):
327327

328328
with mock.patch('sys.argv', test_args):
329329
from version_scanner import main
330-
try:
330+
with pytest.raises(SystemExit):
331331
main()
332-
except SystemExit:
333-
pass
334332

335333
mock_load_ignore.assert_called_once()
336334
args, kwargs = mock_load_ignore.call_args

0 commit comments

Comments
 (0)