summaryrefslogtreecommitdiff
path: root/tests/test_history.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_history.py')
-rw-r--r--tests/test_history.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_history.py b/tests/test_history.py
index 60ffdb3a..b6dc66a2 100644
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -26,9 +26,12 @@ def test_base_help_history(base_app):
assert out == normalize(HELP_HISTORY)
def test_exclude_from_history(base_app, monkeypatch):
- # Mock out the os.system call so we don't actually open an editor
- m = mock.MagicMock(name='system')
- monkeypatch.setattr("os.system", m)
+ # Set a fake editor just to make sure we have one. We aren't really going to call it due to the mock
+ base_app.editor = 'fooedit'
+
+ # Mock out the subprocess.Popen call so we don't actually open an editor
+ m = mock.MagicMock(name='Popen')
+ monkeypatch.setattr("subprocess.Popen", m)
# Run edit command
run_cmd(base_app, 'edit')
@@ -42,6 +45,7 @@ def test_exclude_from_history(base_app, monkeypatch):
# Now run a command which isn't excluded from the history
run_cmd(base_app, 'help')
+
# And verify we have a history now ...
out = run_cmd(base_app, 'history')
expected = normalize(""" 1 help""")