diff --git a/tests/test_lib_resolver.py b/tests/test_lib_resolver.py index 81e2ed6..d9f780b 100644 --- a/tests/test_lib_resolver.py +++ b/tests/test_lib_resolver.py @@ -21,7 +21,15 @@ from mckicad.utils.sexp_tree import find_recursive, parse # Fixtures # --------------------------------------------------------------------------- -DEVICE_LIB = "/usr/share/kicad/symbols/Device.kicad_sym" +# Locate the system symbol dir cross-platform (macOS/Linux/Windows) via the +# same resolver the code uses, rather than a hardcoded Linux path — otherwise +# `requires_kicad` tests silently skip on macOS even when KiCad is installed. +_SYMBOL_DIR = get_kicad_symbol_dir() +DEVICE_LIB = ( + os.path.join(_SYMBOL_DIR, "Device.kicad_sym") + if _SYMBOL_DIR + else "/usr/share/kicad/symbols/Device.kicad_sym" +) GLOBAL_SYM_LIB_TABLE_9 = os.path.expanduser("~/.config/kicad/9.0/sym-lib-table") GLOBAL_SYM_LIB_TABLE_8 = os.path.expanduser("~/.config/kicad/8.0/sym-lib-table")