summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-11-21 14:44:15 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-11-21 14:44:15 -0500
commit20951e94a213eaec3a2f46f8089099256329d0e7 (patch)
tree02cf6743ce8b8d411fd4e2148b8e90d5806c483a
parent48924c662faeaafb024ffc821698918d7c954fd2 (diff)
downloadcmd2-git-editors.tar.gz
Fix unit test that was failing when EDITOR environment variable was seteditors
-rw-r--r--tests/test_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index f4a082ae..5336ccfd 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -652,7 +652,7 @@ def test_find_editor_not_specified():
editor = cu.find_editor()
assert editor
- # Overwrite path env setting with invalid path. No editor should be found.
- with mock.patch.dict(os.environ, {'PATH': 'fake_dir'}):
+ # Overwrite path env setting with invalid path, clear all other env vars so no editor should be found.
+ with mock.patch.dict(os.environ, {'PATH': 'fake_dir'}, clear=True):
editor = cu.find_editor()
assert editor is None