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

Commit6a8ed70

Browse files
committed
Run test_env_vars_for_windows_tests only on Windows
This skips the tests of how the HIDE_WINDOWS_KNOWN_ERRORS andHIDE_WINDOWS_FREEZE_ERRORS environment variables affect thesame-named attributes of git.util, except when testing on Windows.These are parsed only to ever set a True value on Windows, butchecking that this is the case is less important ever sincegit.util.rmtree was changed to not check HIDE_WINDOWS_KNOWN_ERRORSon other systems (and this is covered in other tests).Setting the variables to True on non-Windows systems would stillhave a bad effect on the tests themselves, some of which use themas skip or xfail conditions separate from the skipping logic ingit.util.rmtree. However, this is effectively using them as part ofthe test suite (which they were initially meant for and which theymay eventually go back to being, for#790), where they would notordinarily have tests.The benefit and motivation for running these tests only on Windowsis that the tests can be simplified, so that their parameter setsare no longer confusing. That change is also made here.
1 parentb12a54a commit6a8ed70

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

‎test/test_util.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,28 @@ def _run_parse(name, value):
207207
)
208208
returnast.literal_eval(output)
209209

210+
@pytest.mark.skipif(
211+
os.name!="nt",
212+
reason="These environment variables are only used on Windows.",
213+
)
210214
@pytest.mark.parametrize(
211215
"env_var_value, expected_truth_value",
212216
[
213-
(None,os.name=="nt"),#True on Windows when the environment variable is unset.
217+
(None,True),#When the environment variable is unset.
214218
("",False),
215219
(" ",False),
216220
("0",False),
217-
("1",os.name=="nt"),
221+
("1",True),
218222
("false",False),
219-
("true",os.name=="nt"),
223+
("true",True),
220224
("False",False),
221-
("True",os.name=="nt"),
225+
("True",True),
222226
("no",False),
223-
("yes",os.name=="nt"),
227+
("yes",True),
224228
("NO",False),
225-
("YES",os.name=="nt"),
229+
("YES",True),
226230
(" no ",False),
227-
(" yes ",os.name=="nt"),
231+
(" yes ",True),
228232
],
229233
)
230234
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp