MCPcopy
hub / github.com/mitmproxy/mitmproxy / await_log

Method await_log

test/conftest.py:58–65  ·  view source on GitHub ↗
(self, text, timeout=2)

Source from the content-addressed store, hash-verified

56 self.caplog.set_level(level, logger)
57
58 async def await_log(self, text, timeout=2):
59 await asyncio.sleep(0)
60 for i in range(int(timeout / 0.01)):
61 if text in self.caplog.text:
62 return True
63 else:
64 await asyncio.sleep(0.01)
65 raise AssertionError(f"Did not find {text!r} in log:\n{self.caplog.text}")
66
67 def clear(self) -> None:
68 self.caplog.clear()

Callers 15

test_exception_handlerFunction · 0.80
test_tcp_start_stopFunction · 0.80
test_tcp_timeoutFunction · 0.80
test_transparentFunction · 0.80
test_udp_start_stopFunction · 0.80
test_dual_stackFunction · 0.80
test_dns_start_stopFunction · 0.80
test_local_redirectorFunction · 0.80
test_simpleMethod · 0.80
test_reloadMethod · 0.80
test_exceptionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected