[pypy-commit] pypy default: improve the test to check that __thisclass__ returns the first argument,

arigo pypy.commits at gmail.com
Sat Mar 5 11:02:21 EST 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r82788:72ff295d1274
Date: 2016-03-05 17:01 +0100
http://bitbucket.org/pypy/pypy/changeset/72ff295d1274/

Log:	improve the test to check that __thisclass__ returns the first
	argument, and not e.g. the class of the instance

diff --git a/pypy/module/__builtin__/test/test_descriptor.py b/pypy/module/__builtin__/test/test_descriptor.py
--- a/pypy/module/__builtin__/test/test_descriptor.py
+++ b/pypy/module/__builtin__/test/test_descriptor.py
@@ -244,6 +244,11 @@
 
         assert super(A, A()).__thisclass__ is A
 
+        class B(A):
+            pass
+
+        assert super(B, B()).__thisclass__ is B
+        assert super(A, B()).__thisclass__ is A
 
     def test_property_docstring(self):
         assert property.__doc__.startswith('property')


More information about the pypy-commit mailing list