Skip to content

Navigation Menu

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

Appearance settings

Commit 6a8ed70

Browse filesBrowse files
committed
Run test_env_vars_for_windows_tests only on Windows
This skips the tests of how the HIDE_WINDOWS_KNOWN_ERRORS and HIDE_WINDOWS_FREEZE_ERRORS environment variables affect the same-named attributes of git.util, except when testing on Windows. These are parsed only to ever set a True value on Windows, but checking that this is the case is less important ever since git.util.rmtree was changed to not check HIDE_WINDOWS_KNOWN_ERRORS on other systems (and this is covered in other tests). Setting the variables to True on non-Windows systems would still have a bad effect on the tests themselves, some of which use them as skip or xfail conditions separate from the skipping logic in git.util.rmtree. However, this is effectively using them as part of the test suite (which they were initially meant for and which they may eventually go back to being, for #790), where they would not ordinarily have tests. The benefit and motivation for running these tests only on Windows is that the tests can be simplified, so that their parameter sets are no longer confusing. That change is also made here.
1 parent b12a54a commit 6a8ed70
Copy full SHA for 6a8ed70

File tree

1 file changed

+11
-7
lines changed
Filter options

1 file changed

+11
-7
lines changed

‎test/test_util.py

Copy file name to clipboardExpand all lines: test/test_util.py
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,24 +207,28 @@ def _run_parse(name, value):
207207
)
208208
return ast.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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.