[pypy-svn] r9998 - pypy/dist/pypy/lib/test2

hpk at codespeak.net hpk at codespeak.net
Mon Mar 21 17:28:34 CET 2005


Author: hpk
Date: Mon Mar 21 17:28:34 2005
New Revision: 9998

Added:
   pypy/dist/pypy/lib/test2/test_pickle_extra.py
      - copied unchanged from r9997, pypy/dist/pypy/lib/test2/test_pickle.py
Removed:
   pypy/dist/pypy/lib/test2/test_pickle.py
Log:
this are really extra tests in addition to the standard regrtest 


Deleted: /pypy/dist/pypy/lib/test2/test_pickle.py
==============================================================================
--- /pypy/dist/pypy/lib/test2/test_pickle.py	Mon Mar 21 17:28:34 2005
+++ (empty file)
@@ -1,54 +0,0 @@
-# -*- coding: iso-8859-1 -*-
-import unittest, test.test_support
-import pickle
-
-class Picklable(object):
-    def __init__(self, a=555):
-        self.a = a
-    def __eq__(self, other):
-        return self.a == other.a
-    def __str__(self):
-        return '%s(%r)' % (self.__class__.__name__, self.a)
-    __repr__ = __str__
-
-class PicklableSpecial2(Picklable):
-    def __reduce__(self):
-        return self.__class__, (self.a,)
-
-class PicklableSpecial3(Picklable):
-    def __reduce__(self):
-        return self.__class__, (), self.a
-    def __setstate__(self, a):
-        self.a = a
-
-class PicklableSpecial4(Picklable):
-    def __reduce_ex__(self, proto):
-        return self.__class__, (), self.a
-    def __setstate__(self, a):
-        self.a = a
-
-class PickleTest(unittest.TestCase):
-
-    def _pickle_some(self, x):
-        for proto in range(pickle.HIGHEST_PROTOCOL + 1):
-            s = pickle.dumps(x, proto)
-            y = pickle.loads(s)
-            self.assertEqual(x, y)
-
-    def test_pickle_plain(self):
-        self._pickle_some(Picklable(5))
-
-    def test_pickle_special2(self):
-        self._pickle_some(PicklableSpecial2(66))
-
-    def test_pickle_special3(self):
-        self._pickle_some(PicklableSpecial3(7))
-
-    def test_pickle_special4(self):
-        self._pickle_some(PicklableSpecial4(17))
-
-def test_main():
-    test.test_support.run_unittest(PickleTest)
-
-if __name__ == "__main__":
-    test_main()



More information about the Pypy-commit mailing list