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

Function test_server_run_with_repl

tests/test_cli.py:352–372  ·  view source on GitHub ↗
(caplog, capsys)

Source from the content-addressed store, hash-verified

350
351
352def test_server_run_with_repl(caplog, capsys):
353 record = (
354 "sanic.error",
355 40,
356 "Can't start REPL in non-interactive mode. "
357 "You can only run with --repl in a TTY.",
358 )
359
360 def run():
361 command = ["fake.server.app", "--repl", f"-p={get_port()}"]
362 return capture(command, capsys=capsys)
363
364 with patch("sanic.cli.app.is_atty", return_value=True):
365 result = run()
366
367 assert record not in caplog.record_tuples
368 assert "Welcome to the Sanic interactive console" in result.err
369 assert ">>> " in result.out
370
371 run()
372 assert record in caplog.record_tuples
373
374
375def test_command_no_args(caplog):

Callers

nothing calls this directly

Calls 2

patchFunction · 0.85
runFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…