Skip to content

Commit 59b52df

Browse files
committed
Fix Windows path compatibility in absolute path tests
The tests were comparing string representations of Path objects, which fails on Windows where Path('/tmp/file.json') becomes 'D:\tmp\file.json'. Changed assertions to compare Path objects directly, which works cross-platform by normalizing paths internally. Fixes: - test_get_local_state_path_env_absolute - test_get_upstream_cache_path_env_absolute
1 parent 016c537 commit 59b52df

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/test_local_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def test_get_local_state_path_env_absolute(self, monkeypatch):
229229
"""Test absolute path from environment variable."""
230230
monkeypatch.setenv("CLI_AUDIT_LOCAL_FILE", "/tmp/local_state.json")
231231
path = get_local_state_path()
232-
assert str(path) == "/tmp/local_state.json"
232+
assert path == Path("/tmp/local_state.json")
233233

234234

235235
class TestLoadLocalState:

tests/test_upstream_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_get_upstream_cache_path_env_absolute(self, monkeypatch):
200200
"""Test absolute path from environment variable."""
201201
monkeypatch.setenv("CLI_AUDIT_UPSTREAM_FILE", "/tmp/upstream.json")
202202
path = get_upstream_cache_path()
203-
assert str(path) == "/tmp/upstream.json"
203+
assert path == Path("/tmp/upstream.json")
204204

205205

206206
class TestLoadUpstreamCache:

0 commit comments

Comments
 (0)