Author: Romain Guillebert <romain...@gmail.com> Branch: py3k Changeset: r51488:176a25c48305 Date: 2012-01-19 17:17 +0100 http://bitbucket.org/pypy/pypy/changeset/176a25c48305/
Log: (antocuni, rguillebert) Add a marshalling test of pycode objects diff --git a/pypy/module/marshal/test/test_marshalimpl.py b/pypy/module/marshal/test/test_marshalimpl.py --- a/pypy/module/marshal/test/test_marshalimpl.py +++ b/pypy/module/marshal/test/test_marshalimpl.py @@ -55,6 +55,17 @@ z = marshal.loads('I\x00\x1c\xf4\xab\xfd\xff\xff\xff') assert z == -10000000000 + def test_marshal_code_object(self): + def foo(a, b): + pass + + import marshal + s = marshal.dumps(foo.__code__) + code2 = marshal.loads(s) + for attr_name in dir(code2): + if attr_name.startswith("co_"): + assert getattr(code2, attr_name) == getattr(foo.__code__, attr_name) + class AppTestMarshalSmallLong(AppTestMarshalMore): def setup_class(cls): _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit