File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,12 @@ def test_base_help_history(base_app):
2626 assert out == normalize (HELP_HISTORY )
2727
2828def test_exclude_from_history (base_app , monkeypatch ):
29- # Mock out the os.system call so we don't actually open an editor
30- m = mock .MagicMock (name = 'system' )
31- monkeypatch .setattr ("os.system" , m )
29+ # Set a fake editor just to make sure we have one. We aren't really going to call it due to the mock
30+ base_app .editor = 'fooedit'
31+
32+ # Mock out the subprocess.Popen call so we don't actually open an editor
33+ m = mock .MagicMock (name = 'Popen' )
34+ monkeypatch .setattr ("subprocess.Popen" , m )
3235
3336 # Run edit command
3437 run_cmd (base_app , 'edit' )
@@ -42,6 +45,7 @@ def test_exclude_from_history(base_app, monkeypatch):
4245
4346 # Now run a command which isn't excluded from the history
4447 run_cmd (base_app , 'help' )
48+
4549 # And verify we have a history now ...
4650 out = run_cmd (base_app , 'history' )
4751 expected = normalize (""" 1 help""" )
You can’t perform that action at this time.
0 commit comments