mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[cleanup] deprecate `sphinx.testing.util.strip_escseq in favor of sphinx.util.console.strip_colors` (#12186)
This commit is contained in:
@@ -25,8 +25,8 @@ from sphinx.builders.linkcheck import (
|
||||
RateLimit,
|
||||
)
|
||||
from sphinx.deprecation import RemovedInSphinx80Warning
|
||||
from sphinx.testing.util import strip_escseq
|
||||
from sphinx.util import requests
|
||||
from sphinx.util.console import strip_colors
|
||||
|
||||
from tests.utils import CERT_FILE, http_server
|
||||
|
||||
@@ -588,7 +588,7 @@ def test_linkcheck_allowed_redirects(app, warning):
|
||||
}
|
||||
|
||||
assert ("index.rst:3: WARNING: redirect http://localhost:7777/path2 - with Found to "
|
||||
"http://localhost:7777/?redirected=1\n" in strip_escseq(warning.getvalue()))
|
||||
"http://localhost:7777/?redirected=1\n" in strip_colors(warning.getvalue()))
|
||||
assert len(warning.getvalue().splitlines()) == 1
|
||||
|
||||
|
||||
@@ -785,7 +785,7 @@ def test_too_many_requests_retry_after_int_delay(app, capsys, status):
|
||||
"info": "",
|
||||
}
|
||||
rate_limit_log = "-rate limited- http://localhost:7777/ | sleeping...\n"
|
||||
assert rate_limit_log in strip_escseq(status.getvalue())
|
||||
assert rate_limit_log in strip_colors(status.getvalue())
|
||||
_stdout, stderr = capsys.readouterr()
|
||||
assert stderr == textwrap.dedent(
|
||||
"""\
|
||||
|
||||
Reference in New Issue
Block a user