Author: Devin Jeanpierre <[email protected]>
Branch:
Changeset: r85296:556c43cacee6
Date: 2016-06-20 18:31 -0700
http://bitbucket.org/pypy/pypy/changeset/556c43cacee6/
Log: Make test_typeobject.py CPython compatible (with pytest -A).
The comment previously said the size in CPython increased by 6, but
that isn't true on my system, where it increases by 16. I suspect it
depends on platform or is otherwise not worth staying consistent
with.
(And it isn't as if we tested it before... :])
diff --git a/pypy/module/cpyext/test/test_typeobject.py
b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -897,7 +897,6 @@
module.footype("X", (object,), {})
def test_app_subclass_of_c_type(self):
- # on cpython, the size changes (6 bytes added)
module = self.import_module(name='foo')
size = module.size_of_instances(module.fooType)
class f1(object):
@@ -907,7 +906,11 @@
class bar(f1, f2):
pass
assert bar.__base__ is f2
- assert module.size_of_instances(bar) == size
+ # On cpython, the size changes.
+ if '__pypy__' in sys.builtin_module_names:
+ assert module.size_of_instances(bar) == size
+ else:
+ assert module.size_of_instances(bar) >= size
def test_app_cant_subclass_two_types(self):
module = self.import_module(name='foo')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit