[Python-checkins] r62459 - python/branches/tlee-ast-optimize/Lib/test/test_optimizer.py

thomas.lee python-checkins at python.org
Tue Apr 22 14:44:28 CEST 2008


Author: thomas.lee
Date: Tue Apr 22 14:44:28 2008
New Revision: 62459
Log:
Use compileast.
Modified:
 python/branches/tlee-ast-optimize/Lib/test/test_optimizer.py
Modified: python/branches/tlee-ast-optimize/Lib/test/test_optimizer.py
==============================================================================
--- python/branches/tlee-ast-optimize/Lib/test/test_optimizer.py	(original)
+++ python/branches/tlee-ast-optimize/Lib/test/test_optimizer.py	Tue Apr 22 14:44:28 2008
@@ -91,15 +91,13 @@
 )
 
 for code, expected in tests:
- ast = compile(code, "<string>", "exec", _ast.PyCF_ONLY_AST)
-
+ ast = self.compileast(code)
 if type(expected) is int:
 actual = ast.body[0].value.n
 elif type(expected) is str:
 actual = ast.body[0].value.s
 else:
 raise Exception("Unexpected value: %s" % (expected,))
-
 self.assertEqual(expected, actual)
 
 def test_binop_fold_num_with_variable(self):


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /