"""Windows 'file in use': every swap of a state file waits and retries (atomic.replace), and the message does not blame permissions.""" import re import unittest from pathlib import Path from unittest import mock from strata_control import atomic, private_files ROOT = Path(__file__).resolve().parents[2] SITES = ["strata_control/calibration.py", "strata_control/components.py", "strata_control/presets.py", "strata_control/preset_marks.py", "strata_control/procs.py", "strata_control/profiles.py", "strata_control/tune_apply.py", "strata_control/updater.py", "strata_cli/bench.py", "strata_cli/connections.py", "strata_cli/launch/runner.py", "strata_cli/launch/store.py", "strata_cli/tune_commands.py", "serve/runconfig.py"] class Sites(unittest.TestCase): def test_no_bare_os_replace_is_left_in_the_state_file_writers(self): for rel in SITES: text = (ROOT / rel).read_text(encoding="utf-8") bare = [l for l in text.splitlines() if re.search(r"(?