From: Guido van Rossum Date: Wed, 19 Dec 2001 16:58:54 +0000 (+0000) Subject: Add test for pickling new-style class with custom metaclass. X-Git-Tag: v2.2.1c1~294 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04a866170dcad6a4e806fedca0d5e38ebe11867b;p=thirdparty%2FPython%2Fcpython.git Add test for pickling new-style class with custom metaclass. --- diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 71640dbfc5ae..1b58edb9e461 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -24,6 +24,12 @@ class initarg(C): def __getinitargs__(self): return self.a, self.b +class metaclass(type): + pass + +class use_metaclass(object): + __metaclass__ = metaclass + # break into multiple strings to avoid confusing font-lock-mode DATA = """(lp1 I0 @@ -236,6 +242,12 @@ class AbstractPickleTests(unittest.TestCase): def test_getinitargs(self): pass + def test_metaclass(self): + a = use_metaclass() + s = self.dumps(a) + b = self.loads(s) + self.assertEqual(a.__class__, b.__class__) + class AbstractPickleModuleTests(unittest.TestCase): def test_dump_closed_file(self):