Skip to content

Commit db4c786

Browse files
committed
Fix test to use Bool when calling type-bool type aliases.
1 parent 275b468 commit db4c786

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

tests/test_type_eval.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,15 +1184,7 @@ def test_eval_bool_04():
11841184

11851185

11861186
type IsIntBool[T] = Bool[IsSub[T, int]]
1187-
type IsIntLiteral[T] = Literal[True] if IsIntBool[T] else Literal[False]
1188-
1189-
1190-
def test_eval_bool_05():
1191-
d = eval_typing(IsIntLiteral[int])
1192-
assert d == Literal[True]
1193-
1194-
d = eval_typing(IsIntLiteral[str])
1195-
assert d == Literal[False]
1187+
type IsIntLiteral[T] = Literal[True] if Bool[IsIntBool[T]] else Literal[False]
11961188

11971189

11981190
def test_eval_all_01():
@@ -1231,7 +1223,7 @@ def test_eval_all_02():
12311223

12321224
type ContainsAllInt[Ts] = AllOf[*[IsSub[t, int] for t in Iter[Ts]]]
12331225
type ContainsAllIntToLiteral[Ts] = (
1234-
Literal[True] if ContainsAllInt[Ts] else Literal[False]
1226+
Literal[True] if Bool[ContainsAllInt[Ts]] else Literal[False]
12351227
)
12361228

12371229

@@ -1314,7 +1306,7 @@ def test_eval_any_02():
13141306

13151307
type ContainsAnyInt[Ts] = AnyOf[*[IsSub[t, int] for t in Iter[Ts]]]
13161308
type ContainsAnyIntToLiteral[Ts] = (
1317-
Literal[True] if ContainsAnyInt[Ts] else Literal[False]
1309+
Literal[True] if Bool[ContainsAnyInt[Ts]] else Literal[False]
13181310
)
13191311

13201312

0 commit comments

Comments
 (0)