Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/test_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest

from sphinx._cli.util.errors import strip_escape_sequences
from sphinx.cmd import make_mode
from sphinx.cmd.build import get_parser
from sphinx.cmd.make_mode import run_make_mode
Expand Down Expand Up @@ -150,7 +151,7 @@ def test_build_main_parse_arguments_pos_intermixed(
if broken_argparse:
with pytest.raises(SystemExit):
parse_arguments(args)
stderr = capsys.readouterr().err.splitlines()
stderr = strip_escape_sequences(capsys.readouterr().err).splitlines()
assert stderr[-1].endswith('error: unrecognized arguments: filename1 filename2')
else:
assert parse_arguments(args) == EXPECTED_BUILD_MAIN
Expand Down Expand Up @@ -178,7 +179,7 @@ def test_make_mode_parse_arguments_pos_last(
]
with pytest.raises(SystemExit):
run_make_mode(args)
stderr = capsys.readouterr().err.splitlines()
stderr = strip_escape_sequences(capsys.readouterr().err).splitlines()
assert stderr[-1].endswith('error: argument --builder/-b: expected one argument')


Expand All @@ -195,7 +196,7 @@ def test_make_mode_parse_arguments_pos_middle(
]
with pytest.raises(SystemExit):
run_make_mode(args)
stderr = capsys.readouterr().err.splitlines()
stderr = strip_escape_sequences(capsys.readouterr().err).splitlines()
assert stderr[-1].endswith('error: argument --builder/-b: expected one argument')


Expand Down Expand Up @@ -232,5 +233,5 @@ def test_make_mode_parse_arguments_pos_intermixed(
]
with pytest.raises(SystemExit):
run_make_mode(args)
stderr = capsys.readouterr().err.splitlines()
stderr = strip_escape_sequences(capsys.readouterr().err).splitlines()
assert stderr[-1].endswith('error: argument --builder/-b: expected one argument')
Loading