summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r--Lib/test/test_py_compile.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index 5e0a44a..c4e6551 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -132,7 +132,9 @@ class PyCompileTestsBase:
os.chmod(self.directory, mode.st_mode)
def test_bad_coding(self):
- bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
+ bad_coding = os.path.join(os.path.dirname(__file__),
+ 'tokenizedata',
+ 'bad_coding2.py')
with support.captured_stderr():
self.assertIsNone(py_compile.compile(bad_coding, doraise=False))
self.assertFalse(os.path.exists(
@@ -195,7 +197,9 @@ class PyCompileTestsBase:
self.assertEqual(flags, 0b1)
def test_quiet(self):
- bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
+ bad_coding = os.path.join(os.path.dirname(__file__),
+ 'tokenizedata',
+ 'bad_coding2.py')
with support.captured_stderr() as stderr:
self.assertIsNone(py_compile.compile(bad_coding, doraise=False, quiet=2))
self.assertIsNone(py_compile.compile(bad_coding, doraise=True, quiet=2))
@@ -260,14 +264,18 @@ class PyCompileCLITestCase(unittest.TestCase):
self.assertTrue(os.path.exists(self.cache_path))
def test_bad_syntax(self):
- bad_syntax = os.path.join(os.path.dirname(__file__), 'badsyntax_3131.py')
+ bad_syntax = os.path.join(os.path.dirname(__file__),
+ 'tokenizedata',
+ 'badsyntax_3131.py')
rc, stdout, stderr = self.pycompilecmd_failure(bad_syntax)
self.assertEqual(rc, 1)
self.assertEqual(stdout, b'')
self.assertIn(b'SyntaxError', stderr)
def test_bad_syntax_with_quiet(self):
- bad_syntax = os.path.join(os.path.dirname(__file__), 'badsyntax_3131.py')
+ bad_syntax = os.path.join(os.path.dirname(__file__),
+ 'tokenizedata',
+ 'badsyntax_3131.py')
rc, stdout, stderr = self.pycompilecmd_failure('-q', bad_syntax)
self.assertEqual(rc, 1)
self.assertEqual(stdout, b'')