Skip to content

Commit

Permalink
Add one more test
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Sep 7, 2022
1 parent d86b4e3 commit 3254a53
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/flytekit/unit/core/test_type_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,17 @@ class Schema(object):
DataclassTransformer().assert_type(gt, pv)
DataclassTransformer().assert_type(Schema, pv)

@dataclass_json
@dataclass
class Bar(object):
x: int

pv = Bar(x=3)
with pytest.raises(
TypeTransformerFailedError, match="Type of Val '<class 'int'>' is not an instance of <class 'types.ArgsSchema'>"
):
DataclassTransformer().assert_type(gt, pv)


def test_union_transformer():
assert UnionTransformer.is_optional_type(typing.Optional[int])
Expand Down

0 comments on commit 3254a53

Please sign in to comment.