-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-108303: Move tokenize-related data to Lib/test/tokenizedata
#109265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 @@ def test_roundtrip(self): | |
|
||
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,8 @@ def test_random_files(self): | |
# 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 | ||
fn = support.findfile("tokenize_tests.txt", subdir='tokenizedata') | ||
tempdir = os.path.dirname(os.path.dirname(fn)) or os.curdir | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about the logical to get tempdir here. Maybe start from file instead? Why is it called tempdir? That's Lib/test/, the directory of test files, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not something I am modifing here. I only changed I can open a new issue about it and dig into it later :)
sobolevn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
testfiles = glob.glob(os.path.join(glob.escape(tempdir), "test*.py")) | ||
|
||
# Tokenize is broken on test_pep3131.py because regular expressions are | ||
|
Uh oh!
There was an error while loading. Please reload this page.