fix: clean up omnivoice import guard and __init__ error masking
Remove OmniVoice = None fallback in nodes/loader.py so missing omnivoice gives a clear ImportError instead of a confusing AttributeError. Restore __init__.py to clean form without the try/except that silently swallowed real import errors. Add omnivoice mock to conftest.py and register a pytest plugin that prevents pytest from treating the project root as a Package node (which would try to import __init__.py outside a package context and fail on the relative import). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+9
-14
@@ -1,18 +1,13 @@
|
||||
try:
|
||||
from .nodes import OmniVoiceModelLoader, OmniVoiceGenerate
|
||||
from .nodes import OmniVoiceModelLoader, OmniVoiceGenerate
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"OmniVoiceModelLoader": OmniVoiceModelLoader,
|
||||
"OmniVoiceGenerate": OmniVoiceGenerate,
|
||||
}
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"OmniVoiceModelLoader": OmniVoiceModelLoader,
|
||||
"OmniVoiceGenerate": OmniVoiceGenerate,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"OmniVoiceModelLoader": "OmniVoice Model Loader",
|
||||
"OmniVoiceGenerate": "OmniVoice Generate",
|
||||
}
|
||||
except ImportError:
|
||||
# Graceful fallback when loaded outside of a package context (e.g. pytest)
|
||||
NODE_CLASS_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"OmniVoiceModelLoader": "OmniVoice Model Loader",
|
||||
"OmniVoiceGenerate": "OmniVoice Generate",
|
||||
}
|
||||
|
||||
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
|
||||
|
||||
Reference in New Issue
Block a user