mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) (#109678)
* gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) (cherry picked from commit1110c5bc82
) * gh-108303: Add `Lib/test/tokenizedata` to `TESTSUBDIRS` (#109314) (cherry picked from commit42ab2cbd7b
) --------- Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
37b261799b
commit
8d99502aac
18 changed files with 40 additions and 24 deletions
|
@ -69,6 +69,7 @@ class MiscSourceEncodingTest(unittest.TestCase):
|
|||
def test_20731(self):
|
||||
sub = subprocess.Popen([sys.executable,
|
||||
os.path.join(os.path.dirname(__file__),
|
||||
'tokenizedata',
|
||||
'coding20731.py')],
|
||||
stderr=subprocess.PIPE)
|
||||
err = sub.communicate()[1]
|
||||
|
@ -101,10 +102,10 @@ class MiscSourceEncodingTest(unittest.TestCase):
|
|||
self.verify_bad_module(module_name)
|
||||
|
||||
def verify_bad_module(self, module_name):
|
||||
self.assertRaises(SyntaxError, __import__, 'test.' + module_name)
|
||||
self.assertRaises(SyntaxError, __import__, 'test.tokenizedata.' + module_name)
|
||||
|
||||
path = os.path.dirname(__file__)
|
||||
filename = os.path.join(path, module_name + '.py')
|
||||
filename = os.path.join(path, 'tokenizedata', module_name + '.py')
|
||||
with open(filename, "rb") as fp:
|
||||
bytes = fp.read()
|
||||
self.assertRaises(SyntaxError, compile, bytes, filename, 'exec')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue