MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / test_shutdown_err

Function test_shutdown_err

test/mitmproxy/addons/test_proxyserver.py:255–271  ·  view source on GitHub ↗
(caplog_async)

Source from the content-addressed store, hash-verified

253
254
255async def test_shutdown_err(caplog_async) -> None:
256 caplog_async.set_level("INFO")
257
258 async def _raise(*_):
259 raise OSError("cannot close")
260
261 ps = Proxyserver()
262 with taddons.context(ps) as tctx:
263 tctx.configure(ps, listen_host="127.0.0.1", listen_port=0)
264 assert await ps.setup_servers()
265 ps.running()
266 assert ps.servers
267 for server in ps.servers:
268 setattr(server, "stop", _raise)
269 tctx.configure(ps, server=False)
270 await caplog_async.await_log("cannot close")
271 await _wait_for_connection_closes(ps)
272
273
274async def lookup_ipv4():

Callers

nothing calls this directly

Calls 8

setup_serversMethod · 0.95
runningMethod · 0.95
ProxyserverClass · 0.90
set_levelMethod · 0.80
contextMethod · 0.80
await_logMethod · 0.80
configureMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…