MCPcopy
hub / github.com/sanic-org/sanic / capture

Function capture

tests/test_cli.py:29–44  ·  view source on GitHub ↗
(command: list[str], caplog=None, capsys=None)

Source from the content-addressed store, hash-verified

27
28
29def capture(command: list[str], caplog=None, capsys=None):
30 if capsys:
31 capsys.readouterr()
32 if caplog:
33 caplog.clear()
34 os.chdir(Path(__file__).parent)
35 try:
36 main(command)
37 except SystemExit:
38 ...
39 if capsys:
40 captured_err = capsys.readouterr()
41 return captured_err
42 if caplog:
43 return [record.message for record in caplog.records]
44 return None
45
46
47def read_app_info(lines: list[str]):

Callers 15

test_server_runFunction · 0.85
test_tls_optionsFunction · 0.85
test_tls_wrong_optionsFunction · 0.85
test_host_port_localhostFunction · 0.85
test_host_portFunction · 0.85
test_num_workersFunction · 0.85
test_debugFunction · 0.85
test_devFunction · 0.85
test_auto_reloadFunction · 0.85
test_access_logsFunction · 0.85

Calls 1

mainFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…