mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
[3.12] gh-108303: Fix and move badsyntax_pep3120.py
(GH-109513) (#130540)
(cherry picked from commit 4dd47c63a9
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
ca9e52dac1
commit
e28097682e
3 changed files with 3 additions and 5 deletions
|
@ -2,12 +2,12 @@ fix = true
|
||||||
extend-exclude = [
|
extend-exclude = [
|
||||||
# Excluded (run with the other AC files in its own separate ruff job in pre-commit)
|
# Excluded (run with the other AC files in its own separate ruff job in pre-commit)
|
||||||
"test_clinic.py",
|
"test_clinic.py",
|
||||||
|
# Excluded (these aren't actually executed, they're just "data files")
|
||||||
|
"tokenizedata/*.py",
|
||||||
# Failed to lint
|
# Failed to lint
|
||||||
"badsyntax_pep3120.py",
|
|
||||||
"encoded_modules/module_iso_8859_1.py",
|
"encoded_modules/module_iso_8859_1.py",
|
||||||
"encoded_modules/module_koi8_r.py",
|
"encoded_modules/module_koi8_r.py",
|
||||||
# Failed to parse
|
# Failed to parse
|
||||||
"badsyntax_3131.py",
|
|
||||||
"test_lib2to3/data/bom.py",
|
"test_lib2to3/data/bom.py",
|
||||||
"test_lib2to3/data/crlf.py",
|
"test_lib2to3/data/crlf.py",
|
||||||
"test_lib2to3/data/different_encoding.py",
|
"test_lib2to3/data/different_encoding.py",
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class PEP3120Test(unittest.TestCase):
|
class PEP3120Test(unittest.TestCase):
|
||||||
|
@ -16,7 +14,7 @@ class PEP3120Test(unittest.TestCase):
|
||||||
|
|
||||||
def test_badsyntax(self):
|
def test_badsyntax(self):
|
||||||
try:
|
try:
|
||||||
import test.badsyntax_pep3120
|
import test.tokenizedata.badsyntax_pep3120
|
||||||
except SyntaxError as msg:
|
except SyntaxError as msg:
|
||||||
msg = str(msg).lower()
|
msg = str(msg).lower()
|
||||||
self.assertTrue('utf-8' in msg)
|
self.assertTrue('utf-8' in msg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue