- Add __init__.py to storymem_src to make it importable as a Python package - Fix test_decord_optional_import to handle missing dependencies gracefully - Test now skips when heavy dependencies (cv2, einops, clip) aren't installed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests for Comfyui_StoryMem
This directory contains tests to verify the custom nodes work correctly.
Running Tests Locally
Install test dependencies
pip install -r tests/requirements-test.txt
Install core dependencies
pip install torch torchvision numpy pillow easydict typing_extensions
Run all tests
pytest tests/ -v
Run specific test file
pytest tests/test_imports.py -v
Run with coverage
pytest tests/ --cov=storymem_wrapper --cov-report=html
Test Structure
test_imports.py
Tests for issue #3 - Import errors preventing module loading:
-
TestImports: Verifies all imports work correctly
test_keyframe_extractor_imports: Tests Dict and Any imports in keyframe_extractor.pytest_storymem_bridge_imports: Tests WanTI2V import (not WanMI2V) in storymem_bridge.pytest_typing_imports_available: Verifies typing module is availabletest_analyze_frame_diversity_signature: Tests method with Dict[str, Any] return type
-
TestModuleStructure: Tests module organization
test_storymem_wrapper_exists: Verifies all wrapper modules existtest_no_syntax_errors: Checks Python syntax in all files
CI/CD Integration
The tests run automatically on:
- Push to main/master branches
- Push to fix/** branches
- Pull requests to main/master
See .github/workflows/test.yml for the full CI configuration.
Test Philosophy
These tests focus on:
- Import correctness: Ensuring no NameError or ImportError from missing types
- Syntax validation: All Python files compile without errors
- Module structure: Core wrapper modules are present and loadable
The tests are designed to pass even when optional dependencies (like the full StoryMem source) are not available, making them suitable for CI environments.