MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_startup_err

Function test_startup_err

test/mitmproxy/addons/test_proxyserver.py:243–252  ·  view source on GitHub ↗
(monkeypatch, caplog)

Source from the content-addressed store, hash-verified

241
242
243async def test_startup_err(monkeypatch, caplog) -> None:
244 async def _raise(*_):
245 raise OSError("cannot bind")
246
247 monkeypatch.setattr(asyncio, "start_server", _raise)
248
249 ps = Proxyserver()
250 with taddons.context(ps):
251 assert not await ps.setup_servers()
252 assert "cannot bind" in caplog.text
253
254
255async def test_shutdown_err(caplog_async) -> None:

Callers

nothing calls this directly

Calls 3

setup_serversMethod · 0.95
ProxyserverClass · 0.90
contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…