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 a85f9b8Copy full SHA for a85f9b8
src/sage/cli/notebook_cmd_test.py
@@ -1,3 +1,5 @@
1
+import io
2
+import sys
3
import argparse
4
5
import pytest
@@ -29,8 +31,14 @@ def test_jupyterlab_explicitly():
29
31
def test_invalid_notebook_choice():
30
32
parser = argparse.ArgumentParser()
33
JupyterNotebookCmd.extend_parser(parser)
- with pytest.raises(SystemExit):
- parser.parse_args(["--notebook", "invalid"])
34
+ with io.StringIO() as f:
35
+ old_sys_stderr = sys.stderr
36
+ try:
37
+ sys.stderr = f
38
+ with pytest.raises(SystemExit):
39
+ parser.parse_args(["--notebook", "invalid"])
40
+ finally:
41
+ sys.stderr = old_sys_stderr
42
43
44
def test_help():
0 commit comments