[pypy-commit] pypy py3k: Fix test_class.py
amauryfa
noreply at buildbot.pypy.org
Fri Feb 3 00:34:50 CET 2012
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r52040:87f8c6c473f8
Date: 2012-01-31 21:01 +0100
http://bitbucket.org/pypy/pypy/changeset/87f8c6c473f8/
Log: Fix test_class.py
diff --git a/pypy/interpreter/test/test_class.py b/pypy/interpreter/test/test_class.py
--- a/pypy/interpreter/test/test_class.py
+++ b/pypy/interpreter/test/test_class.py
@@ -9,41 +9,28 @@
assert c.__class__ == C
def test_metaclass_explicit(self):
+ """
class M(type):
pass
- class C:
- __metaclass__ = M
+ class C(metaclass=M):
+ pass
assert C.__class__ == M
c = C()
assert c.__class__ == C
+ """
def test_metaclass_inherited(self):
+ """
class M(type):
pass
- class B:
- __metaclass__ = M
+ class B(metaclass=M):
+ pass
class C(B):
pass
assert C.__class__ == M
c = C()
assert c.__class__ == C
-
- def test_metaclass_global(self):
- d = {}
- metatest_text = """if 1:
- class M(type):
- pass
-
- __metaclass__ = M
-
- class C:
- pass\n"""
- exec metatest_text in d
- C = d['C']
- M = d['M']
- assert C.__class__ == M
- c = C()
- assert c.__class__ == C
+ """
def test_method(self):
class C(object):
@@ -91,15 +78,6 @@
assert type(int(x)) == int
assert int(x) == 5
- def test_long_subclass(self):
- class R(long):
- pass
- x = R(5L)
- assert type(x) == R
- assert x == 5L
- assert type(long(x)) == long
- assert long(x) == 5L
-
def test_float_subclass(self):
class R(float):
pass
More information about the pypy-commit
mailing list