[pypy-svn] r61533 - pypy/trunk/lib-python/modified-2.5.2/test

antocuni at codespeak.net antocuni at codespeak.net
Tue Feb 3 14:45:04 CET 2009


Author: antocuni
Date: Tue Feb  3 14:45:03 2009
New Revision: 61533

Added:
   pypy/trunk/lib-python/modified-2.5.2/test/test_dis.py
      - copied, changed from r61532, pypy/trunk/lib-python/2.5.2/test/test_dis.py
Log:
mark some tests as impl detail, and port one of those to pypy



Copied: pypy/trunk/lib-python/modified-2.5.2/test/test_dis.py (from r61532, pypy/trunk/lib-python/2.5.2/test/test_dis.py)
==============================================================================
--- pypy/trunk/lib-python/2.5.2/test/test_dis.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/test/test_dis.py	Tue Feb  3 14:45:03 2009
@@ -1,4 +1,5 @@
 from test.test_support import verify, verbose, TestFailed, run_unittest
+from test.test_support import impl_detail, check_impl_detail
 import sys
 import dis
 import StringIO
@@ -11,7 +12,7 @@
     print a
     return 1
 
-dis_f = """\
+dis_f_cpy = """\
  %-4d         0 LOAD_FAST                0 (a)
               3 PRINT_ITEM
               4 PRINT_NEWLINE
@@ -21,6 +22,18 @@
 """%(_f.func_code.co_firstlineno + 1,
      _f.func_code.co_firstlineno + 2)
 
+dis_f_pypy = """\
+ %-4d         0 LOAD_FAST                0 (a)
+              3 PRINT_ITEM
+              4 PRINT_NEWLINE
+
+ %-4d         5 LOAD_CONST               1 (1)
+              8 RETURN_VALUE
+              9 LOAD_CONST               0 (None)
+             12 RETURN_VALUE
+"""%(_f.func_code.co_firstlineno + 1,
+     _f.func_code.co_firstlineno + 2)
+
 
 def bug708901():
     for res in range(1,
@@ -120,11 +133,16 @@
         self.assertEqual(dis.opmap["STORE_NAME"], dis.HAVE_ARGUMENT)
 
     def test_dis(self):
-        self.do_disassembly_test(_f, dis_f)
+        if check_impl_detail(pypy=True):
+            self.do_disassembly_test(_f, dis_f_pypy)
+        else:
+            self.do_disassembly_test(_f, dis_f_cpy)
 
+    @impl_detail("PyPy compilers produce different opcodes")
     def test_bug_708901(self):
         self.do_disassembly_test(bug708901, dis_bug708901)
 
+    @impl_detail("see pypy issue 424")
     def test_bug_1333982(self):
         # This one is checking bytecodes generated for an `assert` statement,
         # so fails if the tests are run with -O.  Skip this test then.



More information about the Pypy-commit mailing list