Skip to content

Commit 3c25971

Browse files
committed
Fix tests on Windows
1 parent 93ac29f commit 3c25971

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

solc_select/infrastructure/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def get_version_source(self) -> str:
7373
return "SOLC_VERSION"
7474

7575
global_version_file = self.config_dir / "global-version"
76-
return str(global_version_file)
76+
return global_version_file.as_posix()
7777

7878
def get_artifact_directory(self, version: SolcVersion) -> Path:
7979
"""Get the directory for a version's artifacts.

tests/utils.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,20 @@ def run_command(
6262
"""
6363
stderr_setting = subprocess.STDOUT if capture_stderr else subprocess.PIPE
6464

65-
result = subprocess.run(
66-
cmd,
67-
shell=True,
68-
capture_output=False,
69-
stdout=subprocess.PIPE,
70-
stderr=stderr_setting,
71-
text=True,
72-
check=check,
73-
)
74-
return result
65+
try:
66+
return subprocess.run(
67+
cmd,
68+
shell=True,
69+
capture_output=False,
70+
stdout=subprocess.PIPE,
71+
stderr=stderr_setting,
72+
text=True,
73+
check=check,
74+
)
75+
except subprocess.CalledProcessError as e:
76+
print("Command failed with CalledProcessError.")
77+
print("Exit code:", e.returncode)
78+
print("Command:", e.cmd)
79+
print("Stdout:", e.stdout)
80+
print("Stderr:", e.stderr)
81+
raise

0 commit comments

Comments
 (0)