[Python-Dev] doctest and pickle

Olemis Lang olemis at gmail.com
Fri Jun 7 18:54:11 CEST 2013


On 6/7/13, Ethan Furman <ethan at stoneleaf.us> wrote:
> Is there a doctest mailing list?  I couldn't find it.
>

JFTR, Testing-in-Python (TiP) ML should be the right target for
general purpose questions about testing, considering docs even for
unittest and doctest
http://lists.idyll.org/listinfo/testing-in-python

[...]
> Any advice on how to make it work?
>
> Here's the excerpt:
>
> ===============================================================================
> Pickling
> --------
>
> Enumerations can be pickled and unpickled::
>
>      >>> from enum import Enum
>      >>> class Fruit(Enum):
>      ...     tomato = 1
>      ...     banana = 2
>      ...     cherry = 3
>      ...
>      >>> from pickle import dumps, loads
>      >>> Fruit.tomato is loads(dumps(Fruit.tomato))
>      True
>

... but it seems I'm still getting in tests an instance of Fruit after
invoking loads (do you ?)

[...]

-- 
Regards,

Olemis.

Apache™ Bloodhound contributor
http://issues.apache.org/bloodhound

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:


More information about the Python-Dev mailing list