From 9c672d40d3e9df58467600373b7f29b0e4b2f3b6 Mon Sep 17 00:00:00 2001 From: mixelpixx Date: Fri, 22 May 2026 17:42:39 -0400 Subject: [PATCH] test(swig-dehydration): init _board_disk_signature in _make_iface fixture (#197) The dehydration recovery test (test_auto_save_recovers_when_save_leaves_ board_dehydrated) builds a KiCADInterface via __new__, skipping __init__. After #173 was rebased onto the #151/#172 auto-save guard, _auto_save_board reads self._board_disk_signature (the content-hash conflict guard), which __init__ normally sets to None. The fixture didn't, so the test tripped an AttributeError before reaching the recovery logic it exercises. Initialise _board_disk_signature = None in the _make_iface helper, matching the pattern already used in test_auto_save_guard.py. Test-only change. Co-authored-by: mixelpixx <11727006+mixelpixx@users.noreply.github.com> --- tests/test_swig_dehydration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_swig_dehydration.py b/tests/test_swig_dehydration.py index 6c65ded..c5af45b 100644 --- a/tests/test_swig_dehydration.py +++ b/tests/test_swig_dehydration.py @@ -58,6 +58,12 @@ def _make_iface() -> Any: iface = KiCADInterface.__new__(KiCADInterface) iface.use_ipc = False iface.ipc_board_api = None + # __init__ is skipped here, so initialise the auto-save signature + # attribute that _auto_save_board's content-divergence guard reads. + # (The guard came from the #151/#172 auto-save work that #173 was + # merged on top of; without this the dehydration recovery test trips + # an AttributeError before reaching the code under test.) + iface._board_disk_signature = None return iface