def dumps_to_cpython(case): print 'dump_to_cpython', `case` try: cpy_marshal.dumps(case, *cpy_dump_version) except ValueError: py.test.skip("this version of CPython doesn't support this object") s = marshal.dumps(case) obj = cpy_marshal.loads(s) assert obj == case
def dumps_subclass(case): try: class Subclass(type(case)): pass case = Subclass(case) except TypeError: py.test.skip("this version of CPython doesn't support this object") s = marshal.dumps(case) obj = marshal.loads(s) assert obj == case
def dumps_and_reload(case): print 'dump_and_reload', `case` s = marshal.dumps(case) obj = marshal.loads(s) assert obj == case