[pypy-svn] r61602 - pypy/trunk/pypy/interpreter/test

fijal at codespeak.net fijal at codespeak.net
Sat Feb 7 13:11:20 CET 2009


Author: fijal
Date: Sat Feb  7 13:11:19 2009
New Revision: 61602

Modified:
   pypy/trunk/pypy/interpreter/test/test_compiler.py
Log:
(everyone) A (failing) test for optimize


Modified: pypy/trunk/pypy/interpreter/test/test_compiler.py
==============================================================================
--- pypy/trunk/pypy/interpreter/test/test_compiler.py	(original)
+++ pypy/trunk/pypy/interpreter/test/test_compiler.py	Sat Feb  7 13:11:19 2009
@@ -766,6 +766,23 @@
         output = s.getvalue()
         assert 'BINARY_ADD' not in output
 
+    def test_remove_ending(self):
+        source = """def f():
+            return 3
+"""
+        exec source
+        code = f.func_code
+        import dis, sys, StringIO
+        s = StringIO.StringIO()
+        so = sys.stdout
+        sys.stdout = s
+        try:
+            dis.dis(code)
+        finally:
+            sys.stdout = so
+        output = s.getvalue()
+        assert output.count('LOAD_CONST') == 1
+
 class AppTestExceptions:
     def test_indentation_error(self):
         source = """if 1:



More information about the Pypy-commit mailing list