summaryrefslogtreecommitdiff
path: root/Lib/test/test_py_compile.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2015-04-13 14:21:02 -0400
committerBrett Cannon <brett@python.org>2015-04-13 14:21:02 -0400
commitf299abdafa0f2b6eb7abae274861b19b361c96bc (patch)
treeafc3a2bf560e30c7725510eda3b57d71ceddba00 /Lib/test/test_py_compile.py
parenta63cc212348e276c8ede32773313c60ff7fda651 (diff)
downloadcpython-git-f299abdafa0f2b6eb7abae274861b19b361c96bc.tar.gz
Issue #23731: Implement PEP 488.
The concept of .pyo files no longer exists. Now .pyc files have an optional `opt-` tag which specifies if any extra optimizations beyond the peepholer were applied.
Diffstat (limited to 'Lib/test/test_py_compile.py')
-rw-r--r--Lib/test/test_py_compile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
index 1abea278a2..bff35dbbcf 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -119,6 +119,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()