Skip to content

Commit 47853ea

Browse files
hrolfurgylfaHrólfur
authored andcommitted
Move sentinel truthy test away from test/narrow.rs
1 parent 8eb0591 commit 47853ea

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

pyrefly/lib/test/narrow.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,21 +3288,6 @@ def f(x: int | bool | MISSING):
32883288
"#,
32893289
);
32903290

3291-
testcase!(
3292-
sentinel_is_truthy,
3293-
r#"
3294-
from typing_extensions import Sentinel
3295-
from typing import Literal, assert_type
3296-
3297-
MISSING = Sentinel("MISSING")
3298-
x: MISSING | None = MISSING
3299-
if x:
3300-
assert_type(x, MISSING)
3301-
else:
3302-
assert_type(x, None)
3303-
"#,
3304-
);
3305-
33063291
testcase!(
33073292
sentinel_narrow_with_type_param,
33083293
r#"

pyrefly/lib/test/sentinel.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,18 @@ MISSING = Sentinel("MISSING")
234234
MISSING.__name__ # E: Object of class `Sentinel` has no attribute `__name__`
235235
"#,
236236
);
237+
238+
testcase!(
239+
sentinel_is_truthy,
240+
r#"
241+
from typing_extensions import Sentinel
242+
from typing import Literal, assert_type
243+
244+
MISSING = Sentinel("MISSING")
245+
x: MISSING | None = MISSING
246+
if x:
247+
assert_type(x, MISSING)
248+
else:
249+
assert_type(x, None)
250+
"#,
251+
);

0 commit comments

Comments
 (0)