summaryrefslogtreecommitdiff
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-06 14:14:49 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-06 14:14:49 +0300
commit986142fb151e4113f92b7b1979d65301ef028176 (patch)
tree8c80f0e83be3d94909f3f5579c12f02e1f4ab9e1 /Lib/test/test_py_compile.py
parent4581daf13ff43a8392614c5199e8cf3f4aa08ada (diff)
parent49f16468feeeb6972bfc6a31c4ce92d6cce30ee9 (diff)
downloadcpython-986142fb151e4113f92b7b1979d65301ef028176.tar.gz
Use support.change_cwd() in tests.
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r--Lib/test/test_py_compile.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index c1fd4f60da..4a6caa5718 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -98,6 +98,7 @@ class PyCompileTests(unittest.TestCase):
self.assertFalse(os.path.exists(
importlib.util.cache_from_source(bad_coding)))
+ @unittest.skipIf(sys.flags.optimize > 0, 'test does not work with -O')
def test_double_dot_no_clobber(self):
# http://bugs.python.org/issue22966
# py_compile foo.bar.py -> __pycache__/foo.cpython-34.pyc
@@ -117,6 +118,10 @@ class PyCompileTests(unittest.TestCase):
self.assertTrue(os.path.exists(cache_path))
self.assertFalse(os.path.exists(pyc_path))
+ def test_optimization_path(self):
+ # Specifying optimized bytecode should lead to a path reflecting that.
+ self.assertIn('opt-2', py_compile.compile(self.source_path, optimize=2))
+
if __name__ == "__main__":
unittest.main()