From a82df84ea9aed56ebccf40096bed233587d3db4e Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 18 Oct 2023 13:33:06 +0300 Subject: [PATCH 1/2] gh-111031: Check `test_fstring.py` in `test_tokenize` --- Lib/test/test_tokenize.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 41b9ebe3374d62..1d6f5daa5a758c 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -1908,9 +1908,6 @@ def test_random_files(self): testfiles.remove(os.path.join(tempdir, "test_unicode_identifiers.py")) - # TODO: Remove this once we can untokenize PEP 701 syntax - testfiles.remove(os.path.join(tempdir, "test_fstring.py")) - for f in ('buffer', 'builtin', 'fileio', 'os', 'platform', 'sys'): testfiles.remove(os.path.join(tempdir, "test_%s.py") % f) From 45944b93d0be5ed005ffd889c5a09bc5dc32de77 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Wed, 18 Oct 2023 16:24:48 +0300 Subject: [PATCH 2/2] Address review --- Lib/test/test_tokenize.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 1d6f5daa5a758c..290f4608c5e739 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -1901,15 +1901,8 @@ def test_random_files(self): tempdir = os.path.dirname(__file__) or os.curdir testfiles = glob.glob(os.path.join(glob.escape(tempdir), "test*.py")) - # Tokenize is broken on test_pep3131.py because regular expressions are - # broken on the obscure unicode identifiers in it. *sigh* - # With roundtrip extended to test the 5-tuple mode of untokenize, - # 7 more testfiles fail. Remove them also until the failure is diagnosed. - - testfiles.remove(os.path.join(tempdir, "test_unicode_identifiers.py")) - - for f in ('buffer', 'builtin', 'fileio', 'os', 'platform', 'sys'): - testfiles.remove(os.path.join(tempdir, "test_%s.py") % f) + # TODO: Remove this once we can untokenize PEP 701 syntax + testfiles.remove(os.path.join(tempdir, "test_fstring.py")) if not support.is_resource_enabled("cpu"): testfiles = random.sample(testfiles, 10)