Skip to content

Commit 4702d24

Browse files
test: compare against str(Path), not a POSIX literal
The provenance serialization test asserted the rendered Path equalled '/mnt/raw'. On Windows str(Path('/mnt/raw')) is '\\mnt\\raw', so the assertion failed on both Windows jobs while passing everywhere else. The behavior under test is unchanged and was always correct: default=str stringifies a Path rather than raising. Only the expectation was platform- specific.
1 parent b37dd2b commit 4702d24

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎tests/unit/test_provenance.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,15 @@ def test_serialize_survives_a_deployment_supplied_source(config):
165165
import datetime
166166
import pathlib
167167

168+
where = pathlib.Path("/mnt/raw")
168169
payload = {
169170
"time": "t",
170-
"source": {"when": datetime.date(2026, 1, 1), "where": pathlib.Path("/mnt/raw")},
171+
"source": {"when": datetime.date(2026, 1, 1), "where": where},
171172
}
172173
rendered = json.loads(provenance.serialize(payload))
173-
assert rendered["source"] == {"when": "2026-01-01", "where": "/mnt/raw"}
174+
# Compare against str(Path), not a literal: the separator is platform-specific
175+
# and the contract under test is that the value is stringified at all.
176+
assert rendered["source"] == {"when": "2026-01-01", "where": str(where)}
174177

175178

176179
def test_source_must_be_serializable_at_assignment():

0 commit comments

Comments
 (0)