Skip to content

Commit c569320

Browse files
committed
Make an old mock.patch.dict on os.environ clearer
This clarifies that the object's contents are patched, rather than patching the attribute used to get the object in the first place. It is also in keeping with the style of patching os.environ elsewhere in the test suite.
1 parent 98877c5 commit c569320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test_git.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def test_insert_after_kwarg_raises(self):
245245

246246
def test_env_vars_passed_to_git(self):
247247
editor = "non_existent_editor"
248-
with mock.patch.dict("os.environ", {"GIT_EDITOR": editor}): # @UndefinedVariable
248+
with mock.patch.dict(os.environ, {"GIT_EDITOR": editor}):
249249
self.assertEqual(self.git.var("GIT_EDITOR"), editor)
250250

251251
@with_rw_directory

0 commit comments

Comments
 (0)