Skip to content

Commit

Permalink
Merge branch 'delayed_list' of github.com:pyiron/pyiron_base into del…
Browse files Browse the repository at this point in the history
…ayed_list
  • Loading branch information
jan-janssen committed Jan 17, 2025
2 parents 9efc7d9 + 1ad74fb commit f8b21a1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/unit/flex/test_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ def my_function_b(a, b=8):
self.assertEqual(len(nodes_dict), 6)
self.assertEqual(len(edges_lst), 6)

def test_delayed_return_types(self):
@job
def my_function_a(a, b=8):
return [a + b]

@job(cores=2, output_key_lst=["0"])
def my_function_b(a, b=8):
return [a + b]

c = my_function_a(a=1, b=2, pyiron_project=self.project, list_length=1)
for a in c:
d = my_function_b(a=a, b=3, pyiron_project=self.project)
self.assertEqual(d.pull(), [6])
self.assertEqual(c.pull(), [3])
nodes_dict, edges_lst = d.get_graph()
self.assertEqual(len(nodes_dict), 7)
self.assertEqual(len(edges_lst), 6)


if __name__ == "__main__":
unittest.main()

0 comments on commit f8b21a1

Please sign in to comment.