summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tokenize.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-09-12 06:37:42 (GMT)
committerGitHub <noreply@github.com>2023-09-12 06:37:42 (GMT)
commit1110c5bc828218086f6397ec05a9312fb73ea30a (patch)
treee552ff4258e48bb6131e3b2cc2f8b397ee3e4cc0 /Lib/test/test_tokenize.py
parent8c813faf864ac1d788a3efc45b4e76c1c3c3b340 (diff)
downloadcpython-1110c5bc828218086f6397ec05a9312fb73ea30a.zip
cpython-1110c5bc828218086f6397ec05a9312fb73ea30a.tar.gz
cpython-1110c5bc828218086f6397ec05a9312fb73ea30a.tar.bz2
gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265)
Diffstat (limited to 'Lib/test/test_tokenize.py')
-rw-r--r--Lib/test/test_tokenize.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index dbefee6..94fb6d9 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -1200,7 +1200,7 @@ class TestTokenizerAdheresToPep0263(TestCase):
"""
def _testFile(self, filename):
- path = os.path.join(os.path.dirname(__file__), filename)
+ path = os.path.join(os.path.dirname(__file__), 'tokenizedata', filename)
with open(path, 'rb') as f:
TestRoundtrip.check_roundtrip(self, f)
@@ -1794,7 +1794,7 @@ class TestRoundtrip(TestCase):
self.check_roundtrip("if x == 1 : \n"
" print(x)\n")
- fn = support.findfile("tokenize_tests.txt")
+ fn = support.findfile("tokenize_tests.txt", subdir="tokenizedata")
with open(fn, 'rb') as f:
self.check_roundtrip(f)
self.check_roundtrip("if x == 1:\n"
@@ -1849,8 +1849,7 @@ class TestRoundtrip(TestCase):
# pass the '-ucpu' option to process the full directory.
import glob, random
- fn = support.findfile("tokenize_tests.txt")
- tempdir = os.path.dirname(fn) or os.curdir
+ 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