Skip to content

Commit 4e7702e

Browse files
committed
fix(morph): return original function in 'register_morph' decorator
While this isn't needed for Taskgraph operation, it makes testing morphs difficult as test functions are unable to call the decorated functions directly.
1 parent a81d10d commit 4e7702e

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/taskgraph/morph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
def register_morph(func):
4040
registered_morphs.append(func)
41+
return func
4142

4243

4344
def amend_taskgraph(taskgraph, label_to_taskid, to_add):

test/test_morph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def fake_morph(taskgraph, label_to_taskid, *args):
8282
label_to_taskid["count"] += 1
8383
return taskgraph, label_to_taskid
8484

85+
assert callable(fake_morph)
8586
assert label_to_taskid == {}
8687
morph.morph(taskgraph, label_to_taskid, None, None)
8788
assert label_to_taskid == {"count": 1}

0 commit comments

Comments
 (0)