Consolidate the provision of a single `http_server` utility method, with `tls_enabled` as a boolean flag,
and rework type annotations to make them more understandable.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
With parallel run of tests, one gets "Address already in use" errors
as all tests attempt to bind to the same port. Fix it with a shared
file-system lock.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Clears warning:
tests/test_build_linkcheck.py::test_connect_to_selfsigned_with_tls_cacerts
tests/test_build_linkcheck.py::test_connect_to_selfsigned_with_requests_env_var
…/venv/lib/python3.8/site-packages/urllib3/connection.py:455: SubjectAltNameWarning: Certificate for localhost has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/urllib3/urllib3/issues/497 for details.)
warnings.warn(
Test `test_connect_to_selfsigned_nonexistent_cert_file` serves two
purposes:
- verify the behavior when the CA bundle file path is incorrect
- flag a leak of REQUESTS_CA_BUNDLE
Assumes that test runs after
`test_connect_to_selfsigned_with_requests_env_var`. Not great, but
better than no testing.
Makes the test more realistic by issuing an HTTP request.
Reduces coupling between test and the code under test.
The `http_server` helper was factored out into a new tests.utils module.