Skip to content

Commit 6a0d024

Browse files
committed
Update tests to account for Win FileNotFoundError
1 parent a363d22 commit 6a0d024

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

tests/test_stemmus_scope.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,23 @@ class TestInit:
1414
def test_model_without_exe(self, tmp_path):
1515
config_file = str(data_folder / "config_file_test.txt")
1616
exe_file = Path(tmp_path) / "STEMMUS_SCOPE"
17-
with pytest.raises(ValueError) as excinfo:
18-
StemmusScope(config_file, model_src_path=exe_file)
19-
assert "Provide a valid path to an executable file" in str(excinfo.value)
17+
if utils.os_name() == 'nt':
18+
with pytest.raises(FileNotFoundError):
19+
StemmusScope(config_file, model_src_path=exe_file)
20+
else:
21+
with pytest.raises(ValueError) as excinfo:
22+
StemmusScope(config_file, model_src_path=exe_file)
23+
assert "Provide a valid path to an executable file" in str(excinfo.value)
2024

2125
def test_model_without_src(self):
2226
config_file = str(data_folder / "config_file_test.txt")
23-
with pytest.raises(ValueError) as excinfo:
24-
StemmusScope(config_file, model_src_path="src")
25-
assert "Provide a valid path to an executable file" in str(excinfo.value)
27+
if utils.os_name() == 'nt':
28+
with pytest.raises(FileNotFoundError):
29+
StemmusScope(config_file, model_src_path="src")
30+
else:
31+
with pytest.raises(ValueError) as excinfo:
32+
StemmusScope(config_file, model_src_path="src")
33+
assert "Provide a valid path to an executable file" in str(excinfo.value)
2634

2735
def test_model_without_interpreter(self, tmp_path):
2836
config_file = str(data_folder / "config_file_test.txt")

0 commit comments

Comments
 (0)