From 4a61ad233d632b726489f79b5e270a7599aef619 Mon Sep 17 00:00:00 2001 From: mixelpixx Date: Sat, 30 May 2026 08:51:46 -0400 Subject: [PATCH] test(symbol-library): init _cache_lock in __new__-based fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The background warm-cache change made list_symbols() guard cache writes with self._cache_lock. _manager_for_fixture() builds the manager via __new__ (to skip disk I/O to system libs), bypassing __init__ where the lock is created, so the 8 SPICE-parsing tests raised AttributeError. Set the lock in the fixture. The string-aware parser itself is correct — all 8 pass once the lock exists. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/test_symbol_library.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_symbol_library.py b/tests/test_symbol_library.py index bc986c5..dfabf4e 100644 --- a/tests/test_symbol_library.py +++ b/tests/test_symbol_library.py @@ -7,6 +7,7 @@ Covers: """ import sys +import threading from pathlib import Path import pytest @@ -24,6 +25,9 @@ def _manager_for_fixture() -> SymbolLibraryManager: manager.project_path = None manager.libraries = {"Simulation_SPICE": str(FIXTURE)} manager.symbol_cache = {} + # list_symbols() guards cache writes with this lock (added alongside the + # background warm-cache). The fixture bypasses __init__, so set it here. + manager._cache_lock = threading.Lock() return manager