From 714d6c3d8839fb6f736de81cc66153f9ceca299e Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Tue, 10 Mar 2026 15:16:52 -0700 Subject: [PATCH 1/2] unskip --- mypy/test/testparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mypy/test/testparse.py b/mypy/test/testparse.py index d9d94a5edc38b..00f234f9088ed 100644 --- a/mypy/test/testparse.py +++ b/mypy/test/testparse.py @@ -92,6 +92,8 @@ def run_case(self, testcase: DataDrivenTestCase) -> None: def test_parse_error(testcase: DataDrivenTestCase) -> None: try: options = parse_options("\n".join(testcase.input), testcase, 0) + if options.python_version < defaults.PYTHON3_VERSION: + options.python_version = defaults.PYTHON3_VERSION if options.python_version != sys.version_info[:2]: skip() # Compile temporary file. The test file contains non-ASCII characters. From 3289e0360b696bb65c54c9bc6392ad8f350f6420 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Tue, 10 Mar 2026 16:00:31 -0700 Subject: [PATCH 2/2] . --- test-data/unit/parse-errors.test | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test-data/unit/parse-errors.test b/test-data/unit/parse-errors.test index 1eb3fbf8cba74..23e24ea034e83 100644 --- a/test-data/unit/parse-errors.test +++ b/test-data/unit/parse-errors.test @@ -12,7 +12,7 @@ def f() pass [out] -file:1: error: Invalid syntax +file:1: error: Expected ':' [case testUnexpectedIndent] 1 @@ -55,7 +55,7 @@ file:1: error: Invalid syntax [case testUnexpectedEof] if 1: [out] -file:1: error: Expected an indented block +file:1: error: Expected an indented block after 'if' statement on line 1 [case testInvalidKeywordArguments1] f(x=y, z) @@ -281,17 +281,17 @@ file:3: error: Inconsistent use of "**" in function signature [case testPrintStatementInPython3] print 1 [out] -file:1: error: Missing parentheses in call to 'print'. Did you mean print(1)? +file:1: error: Missing parentheses in call to 'print'. Did you mean print(...)? [case testInvalidConditionInConditionalExpression] 1 if 2, 3 else 4 [out] -file:1: error: Invalid syntax +file:1: error: Expected 'else' after 'if' expression [case testInvalidConditionInConditionalExpression2] 1 if x for y in z else 4 [out] -file:1: error: Invalid syntax +file:1: error: Expected 'else' after 'if' expression [case testInvalidConditionInConditionalExpression3] 1 if x else for y in z @@ -360,17 +360,17 @@ file:1: error: Invalid syntax [case testParseErrorInExtendedSlicing] x[:, [out] -file:1: error: Unexpected EOF while parsing +file:1: error: '[' was never closed [case testParseErrorInExtendedSlicing2] x[:,:: [out] -file:1: error: Unexpected EOF while parsing +file:1: error: '[' was never closed [case testParseErrorInExtendedSlicing3] x[:,: [out] -file:1: error: Unexpected EOF while parsing +file:1: error: '[' was never closed [case testInvalidEncoding] # foo @@ -407,7 +407,7 @@ file:0: error: Unknown encoding: uft8 2L 0x2L [out] -file:1: error: Invalid syntax +file:1: error: Invalid decimal literal [case testPython2LegacyInequalityInPython3] 1 <> 2 @@ -440,4 +440,4 @@ try: except KeyError, IndexError: pass [out] -file:3: error: Invalid syntax +file:3: error: Multiple exception types must be parenthesized