MCPcopy
hub / github.com/urllib3/urllib3 / test_no_response

Function test_no_response

test/contrib/emscripten/test_emscripten.py:179–195  ·  view source on GitHub ↗
(
    selenium_coverage: typing.Any, testserver_http: PyodideServerInfo
)

Source from the content-addressed store, hash-verified

177
178# no connection - should raise
179def test_no_response(
180 selenium_coverage: typing.Any, testserver_http: PyodideServerInfo
181) -> None:
182 @run_in_pyodide # type: ignore[untyped-decorator]
183 def pyodide_test(selenium_coverage, host: str, port: int) -> None: # type: ignore[no-untyped-def]
184 import http.client
185
186 import pytest
187
188 from urllib3.connection import HTTPConnection
189
190 conn = HTTPConnection(host, port)
191 with pytest.raises(http.client.HTTPException):
192 conn.request("GET", f"http://{host}:{port}/")
193 _ = conn.getresponse()
194
195 pyodide_test(selenium_coverage, testserver_http.http_host, find_unused_port())
196
197
198def test_404(selenium_coverage: typing.Any, testserver_http: PyodideServerInfo) -> None:

Callers

nothing calls this directly

Calls 2

pyodide_testFunction · 0.85
find_unused_portFunction · 0.85

Tested by

no test coverage detected