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>
This commit is contained in:
@@ -58,6 +58,12 @@ def _make_iface() -> Any:
|
|||||||
iface = KiCADInterface.__new__(KiCADInterface)
|
iface = KiCADInterface.__new__(KiCADInterface)
|
||||||
iface.use_ipc = False
|
iface.use_ipc = False
|
||||||
iface.ipc_board_api = None
|
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
|
return iface
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user