With both tests/__init__.py and a root __init__.py present, pytest treats tests as a child of an implicit root package and tries to import the root __init__.py — which uses 'from .nodes import' (relative). That fails outside the ComfyUI loader because pytest invokes it with no parent package. Removing tests/__init__.py switches pytest to rootdir-relative discovery, which leaves the root __init__.py alone.