Skip to content

Commit

Permalink
added check that annotations are types in function task
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Jul 10, 2023
1 parent 200c520 commit 074ae3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pydra/engine/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ def __init__(
val_dflt = val.default
else:
val_dflt = attr.NOTHING
type_ = val.annotation
assert inspect.isclass(type_)

Check warning on line 129 in pydra/engine/task.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/task.py#L128-L129

Added lines #L128 - L129 were not covered by tests
fields.append(
(
val.name,
attr.ib(
default=val_dflt,
type=val.annotation,
type=type_,
metadata={
"help_string": f"{val.name} parameter from {func.__name__}"
},
Expand Down

0 comments on commit 074ae3b

Please sign in to comment.