File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ def main():
18
18
result = runner .invoke (app )
19
19
assert result .exit_code == 1
20
20
21
+ def test_keyboardinterrupt ():
22
+ # Mainly for coverage/completeness
23
+ app = typer .Typer ()
24
+
25
+ @app .command ()
26
+ def main ():
27
+ raise KeyboardInterrupt ()
28
+
29
+ result = runner .invoke (app )
30
+ assert result .exit_code == 130
31
+ assert result .stdout == ""
21
32
22
33
def test_oserror ():
23
34
# Mainly for coverage/completeness
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ def _main(
209
209
click .echo (file = sys .stderr )
210
210
raise click .Abort () from e
211
211
except KeyboardInterrupt as e :
212
- raise click .exceptions .Exit () from e
212
+ raise click .exceptions .Exit (130 ) from e
213
213
except click .ClickException as e :
214
214
if not standalone_mode :
215
215
raise
You can’t perform that action at this time.
0 commit comments