Test Without Framework
The Core Pattern
@node(output_name="result")
def process(text: str) -> str:
return text.upper()
# Test the function directly
def test_process():
result = process.func("hello")
assert result == "HELLO"Why This Works
@node(output_name="doubled")
def double(x: int) -> int:
return x * 2
# These are equivalent:
double(5) # Call through the node wrapper → 10
double.func(5) # Call the raw function → 10Testing Patterns
Unit Test a Single Node
Test with Mocked Dependencies
Test Async Nodes
Test Multiple Outputs
Testing Graphs
Test Graph Construction
Test Graph Execution
Test with Fixtures
Testing Routing Logic
Property-Based Testing
Snapshot Testing
Benefits
What's Next?
Last updated