From 20951e94a213eaec3a2f46f8089099256329d0e7 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Sat, 21 Nov 2020 14:44:15 -0500 Subject: Fix unit test that was failing when EDITOR environment variable was set --- tests/test_utils.py | 4 ++-- 1 file 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 -- cgit v1.2.1