Skip to content

Commit 180e6de

Browse files
committed
update chdir location for according to system platfrom
1 parent 0648ff7 commit 180e6de

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/input/test_core_core.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from datetime import datetime
23
from pathlib import Path
34

@@ -17,7 +18,7 @@ def test_discover_input(create_files, file_types, monkeypatch: pytest.MonkeyPatc
1718
]
1819
)
1920

20-
# Test 1: input is is given and exists
21+
# Test 1: input is given and exists
2122

2223
# 1.a somesy input file
2324
somesy_file = tmp_path / Path("somesy.toml")
@@ -34,13 +35,16 @@ def test_discover_input(create_files, file_types, monkeypatch: pytest.MonkeyPatc
3435
result = discover_input(package_json_file)
3536
assert result == package_json_file
3637

37-
# Test 2: input is is given but does not exist, instead default exists and selected
38+
# Test 2: input is given but does not exist, instead default exists and selected
3839
input_file = tmp_path / Path("somesy2.toml")
3940
result = discover_input(input_file)
4041
assert result == Path(".somesy.toml")
4142

4243
# Test 3: should raise an error when given file or defaults dont exist
43-
monkeypatch.chdir(Path("/tmp"))
44+
if sys.platform == "win32":
45+
monkeypatch.chdir(Path("C:\\"))
46+
else:
47+
monkeypatch.chdir(Path("/tmp"))
4448
input_file = Path("/tmp/somesy.toml")
4549
with pytest.raises(FileNotFoundError):
4650
discover_input(input_file)

0 commit comments

Comments
 (0)