A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/105763.html below:

[Python-Dev] r86570 - in python/branches/py3k: Lib/unittest/case.py Lib/unittest/test/test_case.py Misc/NEWS

[Python-Dev] r86570 - in python/branches/py3k: Lib/unittest/case.py Lib/unittest/test/test_case.py Misc/NEWS [Python-Dev] r86570 - in python/branches/py3k: Lib/unittest/case.py Lib/unittest/test/test_case.py Misc/NEWSAntoine Pitrou solipsis at pitrou.net
Sat Nov 20 16:42:30 CET 2010
On Sat, 20 Nov 2010 16:34:26 +0100 (CET)
michael.foord <python-checkins at python.org> wrote:
> +
> +    def testPickle(self):
> +        # Issue 10326
> +
> +        # Can't use TestCase classes defined in Test class as
> +        # pickle does not work with inner classes
> +        test = unittest.TestCase('run')
> +        for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
> +
> +            # blew up prior to fix
> +            pickled_test = pickle.dumps(test, protocol=protocol)

You must also check that the object can be unpickled, otherwise
making TestCase picklable is not only pointless, but misleading the
user.  Other classes which claim to be picklable (such as e.g.
io.BytesIO) are careful to check that unpickling works fine and
produces an usable object.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4