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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy