From e908de589e55adce55f568224f0dcde96d4eb582 Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Tue, 22 Sep 2026 15:43:17 +0000 Subject: [PATCH] test: absolute-key store test is Windows-aware On Windows a drive-letter key (store\C:\...) is not a valid path, so the write raises OSError (as it did before #87) instead of landing inside the root; assert that, and that the file the key names is untouched. #87's Windows job failed on this and was missed because the Windows job does not fail the workflow. Co-Authored-By: Claude Opus 5 --- tests/test_store_concurrency.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_store_concurrency.py b/tests/test_store_concurrency.py index 5e4c7f8..922005b 100644 --- a/tests/test_store_concurrency.py +++ b/tests/test_store_concurrency.py @@ -11,6 +11,7 @@ import json import logging +import os import subprocess import sys import textwrap @@ -135,6 +136,13 @@ def test_absolute_key_is_written_inside_the_root(tmp_path): victim.write_text("# my source file") root = tmp_path / "store" store = _json_store(root) + if os.name == "nt": + # ``store\\C:\\...`` is not a valid Windows path: the write fails loudly + # (as it did before atomic writes) rather than landing on the victim. + with pytest.raises(OSError): + store[str(victim)] = {"cites": ["x"]} + assert victim.read_text() == "# my source file" + return store[str(victim)] = {"cites": ["x"]} assert victim.read_text() == "# my source file" assert store[str(victim)] == {"cites": ["x"]}