We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cdd703 commit 8f21e32Copy full SHA for 8f21e32
src/sage/cli/notebook_cmd_test.py
@@ -29,8 +29,14 @@ def test_jupyterlab_explicitly():
29
def test_invalid_notebook_choice():
30
parser = argparse.ArgumentParser()
31
JupyterNotebookCmd.extend_parser(parser)
32
- with pytest.raises(SystemExit):
33
- parser.parse_args(["--notebook", "invalid"])
+ with io.StringIO() as f:
+ old_sys_stderr = sys.stderr
34
+ try:
35
+ sys.stderr = f
36
+ with pytest.raises(SystemExit):
37
+ parser.parse_args(["--notebook", "invalid"])
38
+ finally:
39
+ sys.stderr = old_sys_stderr
40
41
42
def test_help():
0 commit comments