MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_reuse

Function test_reuse

test/mitmproxy/tools/web/test_master.py:9–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7
8
9async def test_reuse():
10 async def handler(r, w):
11 pass
12
13 server = await asyncio.start_server(
14 handler, host="127.0.0.1", port=0, reuse_address=False
15 )
16 port = server.sockets[0].getsockname()[1]
17 master = WebMaster(Options(), with_termlog=False)
18 master.options.web_host = "127.0.0.1"
19 master.options.web_port = port
20 with pytest.raises(OSError, match=f"--set web_port={port + 2}"):
21 await master.running()
22 server.close()
23 # tornado registers some callbacks,
24 # we want to run them to avoid fatal warnings.
25 await asyncio.sleep(0)

Callers

nothing calls this directly

Calls 4

runningMethod · 0.95
WebMasterClass · 0.90
OptionsClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…