Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d81aad4
[WIP] Make native parser the default
ilevkivskyi Aug 9, 2026
049c5fe
Also update parse error test output
ilevkivskyi Aug 9, 2026
9511035
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Aug 18, 2026
86a897a
Re-enable and update some more tests
ilevkivskyi Aug 19, 2026
a74105a
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Aug 25, 2026
6bebea2
Fix args parsing; update couple tests
ilevkivskyi Aug 25, 2026
68f2051
Fix/update some more tests
ilevkivskyi Sep 1, 2026
d7c282e
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 2, 2026
1108dda
Update few more tests
ilevkivskyi Sep 2, 2026
199f613
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 6, 2026
938a82a
Update some more tests
ilevkivskyi Sep 6, 2026
1ec9337
Update some parse error tests (run on 3.10 only)
ilevkivskyi Sep 6, 2026
b81937c
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 7, 2026
0cbdf19
Update more tests (hopefully just one more left)
ilevkivskyi Sep 7, 2026
d60dcdb
Fix star-unpack version check
ilevkivskyi Sep 7, 2026
e445f9c
Try running parse tests on current Python version
ilevkivskyi Sep 7, 2026
322bfe5
Debug Windows newline issue (sorry for the noise)
ilevkivskyi Sep 8, 2026
fde2f8c
[WIP] Compare with interpreted mode
ilevkivskyi Sep 8, 2026
41da5d8
Revert "[WIP] Compare with interpreted mode"
ilevkivskyi Sep 8, 2026
432e7cb
Revert "Debug Windows newline issue (sorry for the noise)"
ilevkivskyi Sep 8, 2026
2d85a55
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 8, 2026
443151a
Skip couple more tests
ilevkivskyi Sep 8, 2026
b721bdd
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 9, 2026
cbecee8
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 13, 2026
a612063
Update test
ilevkivskyi Sep 13, 2026
9ce726e
Merge remote-tracking branch 'upstream/master' into default-native-pa…
ilevkivskyi Sep 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update some more tests
  • Loading branch information
ilevkivskyi committed Sep 6, 2026
commit 938a82ac9042151af956a4664df6e5b81e472763
1 change: 1 addition & 0 deletions test-data/unit/check-columns.test
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ if int():
xyz = 0 # type: blurbnard blarb
[out]
main:3:5: error: Syntax error in type comment "blurbnard blarb"
main:3:5: error: Invalid type comment or annotation

[case testColumnProperty]
class A:
Expand Down
12 changes: 8 additions & 4 deletions test-data/unit/check-errorcodes.test
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,24 @@ def f(): # E: Type signature has too many parameters [syntax]
# type: (int) -> None
1

x = 0 # type: x y # E: Syntax error in type comment "x y" [syntax]
x = 0 # type: x y # E: Syntax error in type comment "x y" [syntax] \
# E: Invalid type comment or annotation [valid-type]

[case testErrorCodeSyntaxError3]
[case testErrorCodeSyntaxError3_old_parser]
# This is a bit inconsistent -- syntax error would be more logical?
x: 'a b' # E: Invalid type comment or annotation [valid-type]
for v in x: # type: int, int # E: Syntax error in type annotation [syntax] \
# N: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn)
pass

[case testErrorCodeSyntaxError4]
x = 1 # type: int, int # type: int, int # E: Syntax error in type annotation [syntax] \
# N: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn)

[case testErrorCodeSyntaxErrorIgnoreNote]
# This is a bit inconsistent -- syntax error would be more logical?
x: 'a b' # type: ignore[valid-type]
for v in x: # type: int, int # type: ignore[syntax]
pass
y = 1 # type: int, int # type: ignore[syntax]

[case testErrorCodeIgnore1]
'x'.foobar # type: ignore[attr-defined]
Expand Down
6 changes: 4 additions & 2 deletions test-data/unit/check-fastparse.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
1 + # E: Expected an expression

[case testFastParseTypeCommentSyntaxError]
x = None # type: a : b # E: Syntax error in type comment "a : b"
x = None # type: a : b # E: Syntax error in type comment "a : b" \
# E: Invalid type comment or annotation

[case testFastParseInvalidTypeComment]
x = None # type: a + b # E: Invalid type comment or annotation
Expand Down Expand Up @@ -150,7 +151,8 @@ def f(a, # type: A
[builtins fixtures/dict.pyi]
[out]

[case testFastParsePerArgumentAnnotationsWithAnnotatedBareStar]
-- New parser ignores this instead of failing loudly.
[case testFastParsePerArgumentAnnotationsWithAnnotatedBareStar_old_parser]
def f(*, # type: int # E: Bare * has associated type comment
x # type: str
):
Expand Down
22 changes: 18 additions & 4 deletions test-data/unit/check-functions.test
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,8 @@ class A:
main:6: error: Incompatible types in assignment (expression has type "int", variable has type "A")
main:8: error: Argument 1 to "g" has incompatible type "A"; expected "int"

[case testNestedFunctionInMethodWithTooFewArgumentsInTypeComment]
-- Rejecting this is somewhat tricky in the new parser
[case testNestedFunctionInMethodWithTooFewArgumentsInTypeComment_old_parser]
class A:
def f(self):
# type: () -> None
Expand All @@ -795,7 +796,8 @@ class A:
arg.B # E: "object" has no attribute "B"
[file mod.py]

[case testDeepNestedFunctionWithTooFewArgumentsInTypeComment]
-- Rejecting this is somewhat tricky in the new parser
[case testDeepNestedFunctionWithTooFewArgumentsInTypeComment_old_parser]
class A:
def f(self):
# type: () -> None
Expand Down Expand Up @@ -2152,13 +2154,25 @@ class A:
def f(x, y, z): # type: (..., int) -> None
pass
[out]
main:1: error: Ellipses cannot accompany other parameter types in function type signature
main:1: error: Type signature has too few parameters

[case testEllipsisWithSomethingBeforeItFails]
def f(x, y, z): # type: (int, ...) -> None
pass
[out]
main:1: error: Ellipses cannot accompany other parameter types in function type signature
main:1: error: Type signature has too few parameters

[case testEllipsisWithSomethingAfterItFails2]
def f(x, y): # type: (..., int) -> None
pass
[out]
main:1: error: Unexpected "..."

[case testEllipsisWithSomethingBeforeItFails2]
def f(x, y): # type: (int, ...) -> None
pass
[out]
main:1: error: Unexpected "..."

[case testRejectCovariantArgument]
from typing import TypeVar, Generic
Expand Down
Loading