Skip to content

Commit 28a7aed

Browse files
committed
In some cases a test around Never could mark too many statements after it as unreachable
1 parent 2dc2643 commit 28a7aed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

conformance/tests/constructors_call_metaclass.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ def __new__(cls, x: int) -> Self:
2020
return super().__new__(cls)
2121

2222

23-
assert_type(Class1(), NoReturn)
23+
# This needs to be in a separate scope, because some type checkers might mark
24+
# the statements after it as unreachable.
25+
if bool():
26+
assert_type(Class1(), NoReturn)
2427

2528

2629
class Meta2(type):

0 commit comments

Comments
 (0)