Skip to content

Commit 30cc11a

Browse files
BuildToolsmknorps
BuildTools
authored andcommitted
Paths on Windows are equal regardless of capital/lower case
This commit adds 'path_sets_equal' function that checks if <Paths> created of provided strings are equal or not
1 parent 0653c70 commit 30cc11a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_settings.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,16 @@ def _inner(**kwargs: str):
8484
return _inner
8585

8686

87+
def paths_sets_equal(a: Set[str], b: Set[str]) -> bool:
88+
"""Compare two sets of strings as if they were sets of paths."""
89+
return {Path(element) for element in a} == {Path(element) for element in b}
90+
91+
8792
safe_string = strategies.text(alphabet=string.ascii_letters + string.digits, min_size=1)
8893
nonempty_string_set = strategies.sets(safe_string, min_size=1)
8994
four_different_string_groups = strategies.tuples(
9095
*([nonempty_string_set] * 4),
91-
).filter(lambda ss: all(a != b for a, b in combinations(ss, 2)))
96+
).filter(lambda ss: all(not paths_sets_equal(a, b) for a, b in combinations(ss, 2)))
9297

9398

9499
@given(code_deps_pyenvs_base=four_different_string_groups)

0 commit comments

Comments
 (0)