From e28097682eb96550e30a66c65d929b412bf51d52 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Wed, 26 Feb 2025 09:46:12 +0200 Subject: [3.12] gh-108303: Fix and move `badsyntax_pep3120.py` (GH-109513) (#130540) (cherry picked from commit 4dd47c63a97b3c39cd964ad12431fcdaf76dc823) Co-authored-by: Nikita Sobolev Co-authored-by: Alex Waygood --- Lib/test/.ruff.toml | 4 ++-- Lib/test/badsyntax_pep3120.py | 1 - Lib/test/test_utf8source.py | 4 +--- Lib/test/tokenizedata/badsyntax_pep3120.py | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 Lib/test/badsyntax_pep3120.py create mode 100644 Lib/test/tokenizedata/badsyntax_pep3120.py diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index 1632900..79ee343 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -2,12 +2,12 @@ fix = true extend-exclude = [ # Excluded (run with the other AC files in its own separate ruff job in pre-commit) "test_clinic.py", + # Excluded (these aren't actually executed, they're just "data files") + "tokenizedata/*.py", # Failed to lint - "badsyntax_pep3120.py", "encoded_modules/module_iso_8859_1.py", "encoded_modules/module_koi8_r.py", # Failed to parse - "badsyntax_3131.py", "test_lib2to3/data/bom.py", "test_lib2to3/data/crlf.py", "test_lib2to3/data/different_encoding.py", diff --git a/Lib/test/badsyntax_pep3120.py b/Lib/test/badsyntax_pep3120.py deleted file mode 100644 index d14b4c9..0000000 --- a/Lib/test/badsyntax_pep3120.py +++ /dev/null @@ -1 +0,0 @@ -print("böse") diff --git a/Lib/test/test_utf8source.py b/Lib/test/test_utf8source.py index 97dced8..c42b6aa 100644 --- a/Lib/test/test_utf8source.py +++ b/Lib/test/test_utf8source.py @@ -1,5 +1,3 @@ -# This file is marked as binary in the CVS, to prevent MacCVS from recoding it. - import unittest class PEP3120Test(unittest.TestCase): @@ -16,7 +14,7 @@ class PEP3120Test(unittest.TestCase): def test_badsyntax(self): try: - import test.badsyntax_pep3120 + import test.tokenizedata.badsyntax_pep3120 except SyntaxError as msg: msg = str(msg).lower() self.assertTrue('utf-8' in msg) diff --git a/Lib/test/tokenizedata/badsyntax_pep3120.py b/Lib/test/tokenizedata/badsyntax_pep3120.py new file mode 100644 index 0000000..d14b4c9 --- /dev/null +++ b/Lib/test/tokenizedata/badsyntax_pep3120.py @@ -0,0 +1 @@ +print("böse") -- cgit v0.12