Skip to content

Commit d995c41

Browse files
authored
[MLIR][Python] fix python_test.py to not use is for type hint (#160718)
`is` causes the asserts to fail when the return hint is interpreted as `OpResult | OpResultList | test.SameVariadicResultSizeOpVFV`
1 parent 7d35226 commit d995c41

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlir/test/python/dialects/python_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def types(lst):
904904

905905
assert (
906906
typing.get_type_hints(test.same_variadic_result_vfv)["return"]
907-
is Union[OpResult, OpResultList, test.SameVariadicResultSizeOpVFV]
907+
== Union[OpResult, OpResultList, test.SameVariadicResultSizeOpVFV]
908908
)
909909
assert (
910910
type(test.same_variadic_result_vfv([i[0], i[1]], i[2], [i[3], i[4]]))
@@ -992,7 +992,7 @@ def types(lst):
992992

993993
assert (
994994
typing.get_type_hints(test.results_variadic)["return"]
995-
is Union[OpResult, OpResultList, test.ResultsVariadicOp]
995+
== Union[OpResult, OpResultList, test.ResultsVariadicOp]
996996
)
997997
assert type(test.results_variadic([i[0]])) is OpResult
998998
op_res_variadic = test.ResultsVariadicOp([i[0]])
@@ -1003,7 +1003,7 @@ def types(lst):
10031003
assert type(op_res_variadic.res) is OpResultList
10041004

10051005

1006-
# CHECK-LABEL: TEST: testVariadicAndNormalRegion
1006+
# CHECK-LABEL: TEST: testVariadicAndNormalRegionOp
10071007
@run
10081008
def testVariadicAndNormalRegionOp():
10091009
with Context() as ctx, Location.unknown(ctx):

0 commit comments

Comments
 (0)