[pypy-commit] pypy py3k: fix tests for py3k (old-style classes)

rlamy pypy.commits at gmail.com
Fri Jul 29 11:52:34 EDT 2016


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3k
Changeset: r85910:c2c54266b66d
Date: 2016-07-29 16:51 +0100
http://bitbucket.org/pypy/pypy/changeset/c2c54266b66d/

Log:	fix tests for py3k (old-style classes)

diff --git a/pypy/objspace/std/test/test_typeobject.py b/pypy/objspace/std/test/test_typeobject.py
--- a/pypy/objspace/std/test/test_typeobject.py
+++ b/pypy/objspace/std/test/test_typeobject.py
@@ -675,7 +675,7 @@
         assert repr(A) == "<class 'a.test_repr.<locals>.A'>"
         A.__module__ = 123
         assert repr(A) == "<class 'A'>"
-        assert repr(type(type)) == "<class 'type'>" 
+        assert repr(type(type)) == "<class 'type'>"
         assert repr(complex) == "<class 'complex'>"
         assert repr(property) == "<class 'property'>"
         assert repr(TypeError) == "<class 'TypeError'>"
@@ -1204,9 +1204,6 @@
     def test_instancecheck(self):
         assert int.__instancecheck__(42) is True
         assert int.__instancecheck__(42.0) is False
-        class Foo:
-            __class__ = int
-        assert int.__instancecheck__(Foo()) is False
         class Bar(object):
             __class__ = int
         assert int.__instancecheck__(Bar()) is True
@@ -1214,9 +1211,6 @@
     def test_subclasscheck(self):
         assert int.__subclasscheck__(bool) is True
         assert int.__subclasscheck__(float) is False
-        class Foo:
-            __class__ = int
-        assert int.__subclasscheck__(Foo) is False
         class Bar(object):
             __class__ = int
         assert int.__subclasscheck__(Bar) is False
@@ -1297,7 +1291,7 @@
 
         assert w_A.w_new_function is None
         assert w_B.w_new_function is None
-        assert w_M.w_new_function is None                
+        assert w_M.w_new_function is None
 
         _, w_object_newdescr = space.lookup_in_type_where(space.w_object,
                                                           '__new__')


More information about the pypy-commit mailing list