From e01937e9f670502ad0e99994f17591dfaf9defcc Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 14 Apr 2023 00:05:46 +0100 Subject: [PATCH] test_linkcheck_allowed_redirects: reduce the number of HTTP round-trips by enabling support for HEAD requests This is intended to reduce the number of HTTP requests within this particular test to closer-to-the-norm compared to other tests within the test_build_linkcheck.py module; this test has been failing intermittently and it seems possible that timeouts due to HTTP roundtrip traffic are a contributing factor. (cherry picked from commit c2d5bef58ac416bddf4afe9b3ac37a9a616fbb6e) --- tests/test_build_linkcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_build_linkcheck.py b/tests/test_build_linkcheck.py index 6d8db0d3394..56e9e935f5e 100644 --- a/tests/test_build_linkcheck.py +++ b/tests/test_build_linkcheck.py @@ -419,7 +419,7 @@ def test_follows_redirects_on_GET(app, capsys, warning): 'linkcheck_allowed_redirects': {'http://localhost:7777/.*1': '.*'}, }) def test_linkcheck_allowed_redirects(app, warning): - with http_server(make_redirect_handler(support_head=False)): + with http_server(make_redirect_handler(support_head=True)): app.build() with open(app.outdir / 'output.json', encoding='utf-8') as fp: