File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -77,23 +77,22 @@ def test_union():
7777def test_union_type ():
7878 """Test union types in Python 3.10+"""
7979
80- assert guess_type (int | str ) == [ "integer " , "string" ]
80+ assert set ( guess_type (int | str )) == { "number " , "string" }
8181 assert guess_type (int | float ) == "number"
82- assert guess_type (int | bool ) == ["integer" , "boolean" ]
83- assert guess_type (bool | int ) == ["boolean" , "integer" ]
84- assert guess_type (str | float ) == ["string" , "number" ]
85- assert guess_type (str | bool ) == ["string" , "boolean" ]
86- assert guess_type (float | bool ) == ["number" , "boolean" ]
87- assert guess_type (str | float | bool ) == [
82+ assert set (guess_type (int | bool )) == {"number" , "boolean" }
83+ assert set (guess_type (str | float )) == {"string" , "number" }
84+ assert set (guess_type (str | bool )) == {"string" , "boolean" }
85+ assert set (guess_type (float | bool )) == {"number" , "boolean" }
86+ assert set (guess_type (str | float | bool )) == {
8887 "string" ,
8988 "number" ,
9089 "boolean" ,
91- ]
92- assert guess_type (str | float | bool | None ) == [
90+ }
91+ assert set ( guess_type (str | float | bool | None )) == {
9392 "string" ,
9493 "number" ,
9594 "boolean" ,
96- ]
95+ }
9796
9897
9998def test_literal_type ():
You can’t perform that action at this time.
0 commit comments