Commits

Amaury Forgeot d'Arc committed 4f55bea

Skip part of the test: PyPy now adds a __dict__ to ast.AST objects.

Comments (0)

Files changed (1)

lib-python/modified-2.7.0/test/test_ast.py

                 self._assertTrueorder(value, parent_pos)
 
     def test_AST_objects(self):
-        x = ast.AST()
-        try:
-            x.foobar = 21
-        except AttributeError, e:
-            self.assertEquals(e.args[0],
-                              "'_ast.AST' object has no attribute 'foobar'")
-        else:
-            self.assert_(False)
+        if test_support.check_impl_detail():
+            # PyPy also provides a __dict__ to the ast.AST base class.
 
-        try:
-            ast.AST(lineno=2)
-        except AttributeError, e:
-            self.assertEquals(e.args[0],
-                              "'_ast.AST' object has no attribute 'lineno'")
-        else:
-            self.assert_(False)
+            x = ast.AST()
+            try:
+                x.foobar = 21
+            except AttributeError, e:
+                self.assertEquals(e.args[0],
+                                  "'_ast.AST' object has no attribute 'foobar'")
+            else:
+                self.assert_(False)
+
+            try:
+                ast.AST(lineno=2)
+            except AttributeError, e:
+                self.assertEquals(e.args[0],
+                                  "'_ast.AST' object has no attribute 'lineno'")
+            else:
+                self.assert_(False)
+
         try:
             ast.AST(2)
         except TypeError, e: