From 596023bb076e65cd264f186d4e725d72d1e5f9c8 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sun, 17 Sep 2023 13:03:02 +0300 Subject: [PATCH 1/4] gh-108303: Fix and move `badsyntax_pep3120.py` --- Lib/test/.ruff.toml | 4 ++-- Lib/test/test_utf8source.py | 4 +--- Lib/test/{ => tokenizedata}/badsyntax_pep3120.py | 0 3 files changed, 3 insertions(+), 5 deletions(-) rename Lib/test/{ => tokenizedata}/badsyntax_pep3120.py (100%) diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index a9a4a013dabec9..94b2bbf49a5632 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -4,11 +4,11 @@ select = [ ] extend-exclude = [ # Failed to lint - "badsyntax_pep3120.py", + "tokenizedata/badsyntax_pep3120.py", "encoded_modules/module_iso_8859_1.py", "encoded_modules/module_koi8_r.py", # Failed to parse - "badsyntax_3131.py", + "tokenizedata/badsyntax_3131.py", "support/socket_helper.py", "test_fstring.py", # TODO Fix: F811 Redefinition of unused name diff --git a/Lib/test/test_utf8source.py b/Lib/test/test_utf8source.py index 97dced8a622889..c42b6aaaab579d 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 @@ def test_pep3120(self): 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/badsyntax_pep3120.py b/Lib/test/tokenizedata/badsyntax_pep3120.py similarity index 100% rename from Lib/test/badsyntax_pep3120.py rename to Lib/test/tokenizedata/badsyntax_pep3120.py From 4f84436b6a766a5936edfad85453032285cb2402 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sun, 17 Sep 2023 13:32:23 +0300 Subject: [PATCH 2/4] ABCDEF sort --- Lib/test/.ruff.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index 94b2bbf49a5632..1a905c120af20a 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -4,13 +4,13 @@ select = [ ] extend-exclude = [ # Failed to lint - "tokenizedata/badsyntax_pep3120.py", "encoded_modules/module_iso_8859_1.py", "encoded_modules/module_koi8_r.py", + "tokenizedata/badsyntax_pep3120.py", # Failed to parse - "tokenizedata/badsyntax_3131.py", "support/socket_helper.py", "test_fstring.py", + "tokenizedata/badsyntax_3131.py", # TODO Fix: F811 Redefinition of unused name "test__opcode.py", "test_buffer.py", From c2a4adda5254cc8d927379a70b72accef1aa6840 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sun, 17 Sep 2023 15:31:08 +0300 Subject: [PATCH 3/4] Address review --- Lib/test/.ruff.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index 1a905c120af20a..5cfad2c6a4bb0c 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -3,14 +3,14 @@ select = [ "F811", # Redefinition of unused variable (useful for finding test methods with the same name) ] extend-exclude = [ + # Excluded + "tokenizedata/*.py", # Failed to lint "encoded_modules/module_iso_8859_1.py", "encoded_modules/module_koi8_r.py", - "tokenizedata/badsyntax_pep3120.py", # Failed to parse "support/socket_helper.py", "test_fstring.py", - "tokenizedata/badsyntax_3131.py", # TODO Fix: F811 Redefinition of unused name "test__opcode.py", "test_buffer.py", From 39862848acfb660e784422e6f150c9db9196074b Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 17 Sep 2023 15:33:57 +0300 Subject: [PATCH 4/4] Update Lib/test/.ruff.toml Co-authored-by: Alex Waygood --- Lib/test/.ruff.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml index 5cfad2c6a4bb0c..e202766b147e6d 100644 --- a/Lib/test/.ruff.toml +++ b/Lib/test/.ruff.toml @@ -3,7 +3,7 @@ select = [ "F811", # Redefinition of unused variable (useful for finding test methods with the same name) ] extend-exclude = [ - # Excluded + # Excluded (these aren't actually executed, they're just "data files") "tokenizedata/*.py", # Failed to lint "encoded_modules/module_iso_8859_1.py",