linkcheck: Make the new 'timeout' status opt-in (#12023)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
James Addison
2024-04-12 23:18:22 +01:00
committed by GitHub
parent db7ba522d7
commit 532ad0306e
4 changed files with 40 additions and 3 deletions

View File

@@ -856,7 +856,13 @@ def test_too_many_requests_retry_after_without_header(app, capsys):
)
@pytest.mark.sphinx('linkcheck', testroot='linkcheck-localserver', freshenv=True)
@pytest.mark.sphinx(
'linkcheck', testroot='linkcheck-localserver', freshenv=True,
confoverrides={
'linkcheck_report_timeouts_as_broken': False,
'linkcheck_timeout': 0.01,
}
)
def test_requests_timeout(app):
class DelayedResponseHandler(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
@@ -867,7 +873,6 @@ def test_requests_timeout(app):
self.send_header("Content-Length", "0")
self.end_headers()
app.config.linkcheck_timeout = 0.01
with serve_application(app, DelayedResponseHandler):
app.build()