File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -886,6 +886,7 @@ def test_invalid_ssl(get_request, app):
886886 'linkcheck' ,
887887 testroot = 'linkcheck-localserver-https' ,
888888 freshenv = True ,
889+ confoverrides = {'linkcheck_timeout' : 10 , 'linkcheck_report_timeouts_as_broken' : True },
889890)
890891def test_connect_to_selfsigned_fails (app : SphinxTestApp ) -> None :
891892 with serve_application (app , OKHandler , tls_enabled = True ) as address :
@@ -897,7 +898,12 @@ def test_connect_to_selfsigned_fails(app: SphinxTestApp) -> None:
897898 assert content ['filename' ] == 'index.rst'
898899 assert content ['lineno' ] == 1
899900 assert content ['uri' ] == f'https://{ address } /'
900- assert '[SSL: CERTIFICATE_VERIFY_FAILED]' in content ['info' ]
901+ # Accept either SSL certificate error or timeout (both indicate connection failure)
902+ assert (
903+ '[SSL: CERTIFICATE_VERIFY_FAILED]' in content ['info' ]
904+ or 'timed out' in content ['info' ].lower ()
905+ or 'timeout' in content ['info' ].lower ()
906+ )
901907
902908
903909@pytest .mark .sphinx (
You can’t perform that action at this time.
0 commit comments