Skip to content

Commit

Permalink
Force the problem in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liamhuber committed Feb 15, 2024
1 parent 344d1c4 commit 7d8c354
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Empty file.
16 changes: 16 additions & 0 deletions tests/static/nodes_subpackage/subsub_sibling/demo_nodes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
A demo node package for the purpose of testing node package registration.
"""

from typing import Optional

from pyiron_workflow import Workflow


@Workflow.wrap_as.single_value_node("sum")
def OptionallyAdd(x: int, y: Optional[int] = None) -> int:
y = 0 if y is None else y
return x + y


nodes = [OptionallyAdd]
1 change: 1 addition & 0 deletions tests/unit/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_registration(self):
self.creator.register("static.nodes_subpackage", "sub")
self.assertIsInstance(self.creator.sub.demo_nodes, NodePackage)
self.assertIsInstance(self.creator.sub.subsub_package.demo_nodes, NodePackage)
self.assertIsInstance(self.creator.sub.subsub_sibling.demo_nodes, NodePackage)

with self.subTest("Test re-registration"):
self.creator.register("static.demo_nodes", "demo")
Expand Down

0 comments on commit 7d8c354

Please sign in to comment.