We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 223843c commit d722f00Copy full SHA for d722f00
1 file changed
scripts/gen_dockerfile_test.py
@@ -218,7 +218,8 @@ def mock_error(*args):
218
"""Prevent argparse from calling sys.exit()"""
219
raise AssertionError(*args)
220
221
- with unittest.mock.patch.object(
222
- argparse.ArgumentParser, 'error', mock_error):
+ error_patch = unittest.mock.patch.object(
+ argparse.ArgumentParser, 'error', mock_error)
223
+ with error_patch:
224
with pytest.raises(AssertionError):
225
gen_dockerfile.parse_args(argv)
0 commit comments