Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Samhita Alla <[email protected]>
  • Loading branch information
samhita-alla committed Jul 8, 2022
1 parent 80a39f1 commit edcefef
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/flytekit/unit/core/test_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from dataclasses_json import dataclass_json
from google.protobuf.struct_pb2 import Struct
from pandas._testing import assert_frame_equal
from typing_extensions import Annotated
from typing_extensions import Annotated, get_origin

import flytekit
import flytekit.configuration
Expand Down Expand Up @@ -89,6 +89,14 @@ def my_task(a: int) -> typing.NamedTuple("OutputsBC", b=typing.ForwardRef("int")
assert context_manager.FlyteContextManager.size() == 1


def test_annotated_namedtuple_output():
@task
def my_task() -> typing.NamedTuple("OutputA", a=Annotated[int, "metadata-a"]):
return 1

assert get_origin(my_task.python_interface.outputs["a"]) is Annotated


def test_simple_input_no_output():
@task
def my_task(a: int):
Expand Down

0 comments on commit edcefef

Please sign in to comment.