Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc569320

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

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
deftest_env_vars_passed_to_git(self):
247247
editor="non_existent_editor"
248-
withmock.patch.dict("os.environ", {"GIT_EDITOR":editor}):# @UndefinedVariable
248+
withmock.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)

[8]ページ先頭

©2009-2025 Movatter.jp