MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_run_pyscript_stop

Function test_run_pyscript_stop

tests/test_run_pyscript.py:146–158  ·  view source on GitHub ↗
(base_app, request)

Source from the content-addressed store, hash-verified

144
145
146def test_run_pyscript_stop(base_app, request) -> None:
147 # Verify onecmd_plus_hooks() returns True if any commands in a pyscript return True for stop
148 test_dir = os.path.dirname(request.module.__file__)
149
150 # help.py doesn't run any commands that return True for stop
151 python_script = os.path.join(test_dir, "pyscript", "help.py")
152 stop = base_app.onecmd_plus_hooks(f"run_pyscript {python_script}")
153 assert not stop
154
155 # stop.py runs the quit command which does return True for stop
156 python_script = os.path.join(test_dir, "pyscript", "stop.py")
157 stop = base_app.onecmd_plus_hooks(f"run_pyscript {python_script}")
158 assert stop
159
160
161def test_run_pyscript_environment(base_app, request) -> None:

Callers

nothing calls this directly

Calls 1

onecmd_plus_hooksMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…