From: Michael W. Hudson Date: Thu, 7 Mar 2002 10:12:38 +0000 (+0000) Subject: backport my checkin of X-Git-Tag: v2.2.1c1~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=38983bc5e3af22b5b923f809bcb06c0176123c0e;p=thirdparty%2FPython%2Fcpython.git backport my checkin of revision 1.14 of pickletester.py Special support for pickling os.stat and os.stat_vfs results portably (the types come from different modules on different platforms). Added tests for pickling these types. May be a bugfix candidate. --- diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index e2d2580b8e5d..e16428fa33a7 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -254,6 +254,17 @@ class AbstractPickleTests(unittest.TestCase): s = self.dumps(t) u = self.loads(s) self.assertEqual(t, u) + import os + if hasattr(os, "stat"): + t = os.stat(os.curdir) + s = self.dumps(t) + u = self.loads(s) + self.assertEqual(t, u) + if hasattr(os, "statvfs"): + t = os.statvfs(os.curdir) + s = self.dumps(t) + u = self.loads(s) + self.assertEqual(t, u) class AbstractPickleModuleTests(unittest.TestCase):