summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_cmd2.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 9ce02789..4a9dca31 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -332,6 +332,9 @@ def test_run_script_with_binary_file(base_app, request):
assert "is not an ASCII or UTF-8 encoded text file" in err[0]
def test_run_script_with_python_file(base_app, request):
+ m = mock.MagicMock(name='input', return_value='2')
+ builtins.input = m
+
test_dir = os.path.dirname(request.module.__file__)
filename = os.path.join(test_dir, 'pyscript', 'stop.py')
out, err = run_cmd(base_app, 'run_script {}'.format(filename))