Skip to content

Commit 67dcb15

Browse files
committed
Add test for disabling syntax version checks in .pyi files
Follow-up to #21539.
1 parent fad733f commit 67dcb15

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test-data/unit/pythoneval.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,3 +2298,15 @@ g((1, 2))
22982298
[out]
22992299
_testNativeParserStarUnpackRequiresPython311.py:5: error: Star unpack syntax: requires Python 3.11 or newer (current target: Python 3.10)
23002300
_testNativeParserStarUnpackRequiresPython311.py:6: note: Revealed type is "def [Ts] (x: tuple[*Ts])"
2301+
2302+
[case testNativeParserPEP695InStubNoVersionError]
2303+
# flags: --python-version=3.11 --native-parser --ignore-missing-imports
2304+
import m
2305+
reveal_type(m.f)
2306+
[file m.pyi]
2307+
class C[T]: ...
2308+
def f[T](x: T) -> T: ...
2309+
type Alias[T] = list[T]
2310+
def g[T = int](x: T) -> T: ...
2311+
[out]
2312+
_testNativeParserPEP695InStubNoVersionError.py:3: note: Revealed type is "def [T] (x: T) -> T"

0 commit comments

Comments
 (0)