(
selenium_coverage: typing.Any, testserver_http: PyodideServerInfo
)
| 156 | |
| 157 | # wrong protocol / protocol error etc. should raise an exception of http.client.HTTPException |
| 158 | def test_bad_method( |
| 159 | selenium_coverage: typing.Any, testserver_http: PyodideServerInfo |
| 160 | ) -> None: |
| 161 | @run_in_pyodide # type: ignore[untyped-decorator] |
| 162 | def pyodide_test(selenium_coverage, host: str, port: int) -> None: # type: ignore[no-untyped-def] |
| 163 | import http.client |
| 164 | |
| 165 | import pytest |
| 166 | |
| 167 | from urllib3.connection import HTTPConnection |
| 168 | |
| 169 | conn = HTTPConnection(host, port) |
| 170 | with pytest.raises(http.client.HTTPException): |
| 171 | conn.request("TRACE", f"http://{host}:{port}/") |
| 172 | |
| 173 | pyodide_test( |
| 174 | selenium_coverage, testserver_http.http_host, testserver_http.https_port |
| 175 | ) |
| 176 | |
| 177 | |
| 178 | # no connection - should raise |
nothing calls this directly
no test coverage detected