"F811", # Redefinition of unused variable (useful for finding test methods with the same name)
]
extend-exclude = [
+ # Excluded (these aren't actually executed, they're just "data files")
+ "tokenizedata/*.py",
# Failed to lint
- "badsyntax_pep3120.py",
"encoded_modules/module_iso_8859_1.py",
"encoded_modules/module_koi8_r.py",
"test_source_encoding.py",
# Failed to parse
- "badsyntax_3131.py",
"test_fstring.py",
# TODO Fix: F811 Redefinition of unused name
"test_buffer.py",
with imp.find_module('module_' + mod, self.test_path)[0] as fd:
self.assertEqual(fd.encoding, encoding)
- path = [os.path.dirname(__file__)]
+ path = [os.path.join(os.path.dirname(__file__), 'tokenizedata')]
with self.assertRaises(SyntaxError):
imp.find_module('badsyntax_pep3120', path)
os_helper.rmtree('__pycache__')
def test_issue9319(self):
- path = os.path.dirname(__file__)
+ path = os.path.join(os.path.dirname(__file__), "tokenizedata")
self.assertRaises(SyntaxError,
- imp.find_module, "badsyntax_pep3120", [path])
+ imp.find_module,
+ "badsyntax_pep3120",
+ [path])
def test_load_from_source(self):
# Verify that the imp module can correctly load and find .py files
-# This file is marked as binary in the CVS, to prevent MacCVS from recoding it.
-
import unittest
class PEP3120Test(unittest.TestCase):
def test_badsyntax(self):
try:
- import test.badsyntax_pep3120
+ import test.tokenizedata.badsyntax_pep3120
except SyntaxError as msg:
msg = str(msg).lower()
self.assertTrue('utf-8' in msg)