Skip to content

Commit 79623d0

Browse files
author
Release Manager
committed
gh-40731: Hide spurious stderr output in notebook_cmd_test.py If you look at the log on the CI, without this change, it would print out some stuff on stderr. ``` ============================= test session starts ============================== platform linux -- Python 3.12.11, pytest-8.4.1, pluggy-1.6.0 rootdir: /home/runner/work/sage/sage configfile: pyproject.toml plugins: xdist-3.8.0 collected 76 items / 2 skipped src/sage/cli/eval_cmd_test.py .. usage: pytest [-h] [-n [{jupyter,jupyterlab}]] pytest: error: argument -n/--notebook: invalid choice: 'invalid' (choose from jupyter, jupyterlab) src/sage/cli/notebook_cmd_test.py ..... src/sage/doctest/parsing_test.py ........... ``` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40731 Reported by: user202729 Reviewer(s): Tobias Diez
2 parents e1a3672 + c94d477 commit 79623d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sage/cli/notebook_cmd_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ def test_jupyterlab_explicitly():
2626
assert args.notebook == "jupyterlab"
2727

2828

29-
def test_invalid_notebook_choice():
29+
def test_invalid_notebook_choice(capsys):
3030
parser = argparse.ArgumentParser()
3131
JupyterNotebookCmd.extend_parser(parser)
3232
with pytest.raises(SystemExit):
3333
parser.parse_args(["--notebook", "invalid"])
34+
assert "argument -n/--notebook: invalid choice: 'invalid'" in capsys.readouterr()[1]
3435

3536

3637
def test_help():

0 commit comments

Comments
 (0)