From f0e5d5cdb8608aa8b0de3c8c653aae2201df0736 Mon Sep 17 00:00:00 2001 From: "Thomas J. Fan" Date: Thu, 10 Oct 2024 21:21:54 -0400 Subject: [PATCH] Fix assertion in tes_type_engine_binary_idl (#2801) Signed-off-by: Thomas J. Fan --- .../unit/core/test_type_engine_binary_idl.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/flytekit/unit/core/test_type_engine_binary_idl.py b/tests/flytekit/unit/core/test_type_engine_binary_idl.py index 788fffc930..986fac0c7c 100644 --- a/tests/flytekit/unit/core/test_type_engine_binary_idl.py +++ b/tests/flytekit/unit/core/test_type_engine_binary_idl.py @@ -605,24 +605,24 @@ class DC: @task def t_inner(inner_dc: InnerDC): - assert (type(inner_dc), InnerDC) # type: ignore + assert type(inner_dc) is InnerDC # f: List[FlyteFile] for ff in inner_dc.f: - assert (type(ff), FlyteFile) # type: ignore + assert type(ff) is FlyteFile with open(ff, "r") as f: assert f.read() == "Hello FlyteFile" # j: Dict[int, FlyteFile] for _, ff in inner_dc.j.items(): - assert (type(ff), FlyteFile) # type: ignore + assert type(ff) is FlyteFile with open(ff, "r") as f: assert f.read() == "Hello FlyteFile" # n: FlyteFile - assert (type(inner_dc.n), FlyteFile) # type: ignore + assert type(inner_dc.n) is FlyteFile with open(inner_dc.n, "r") as f: assert f.read() == "Hello FlyteFile" # o: FlyteDirectory - assert (type(inner_dc.o), FlyteDirectory) # type: ignore + assert type(inner_dc.o) is FlyteDirectory assert not inner_dc.o.downloaded with open(os.path.join(inner_dc.o, "file"), "r") as fh: assert fh.read() == "Hello FlyteDirectory" @@ -755,24 +755,24 @@ class DC: enum_status: Status = field(default=Status.PENDING) def t_inner(inner_dc: InnerDC): - assert (type(inner_dc), InnerDC) # type: ignore + assert type(inner_dc) is InnerDC # f: List[FlyteFile] for ff in inner_dc.f: - assert (type(ff), FlyteFile) # type: ignore + assert type(ff) is FlyteFile with open(ff, "r") as f: assert f.read() == "Hello FlyteFile" # j: Dict[int, FlyteFile] for _, ff in inner_dc.j.items(): - assert (type(ff), FlyteFile) # type: ignore + assert type(ff) is FlyteFile with open(ff, "r") as f: assert f.read() == "Hello FlyteFile" # n: FlyteFile - assert (type(inner_dc.n), FlyteFile) # type: ignore + assert type(inner_dc.n) is FlyteFile with open(inner_dc.n, "r") as f: assert f.read() == "Hello FlyteFile" # o: FlyteDirectory - assert (type(inner_dc.o), FlyteDirectory) # type: ignore + assert type(inner_dc.o) is FlyteDirectory assert not inner_dc.o.downloaded with open(os.path.join(inner_dc.o, "file"), "r") as fh: assert fh.read() == "Hello FlyteDirectory"