From 006a0cc6e6ac4e0a8bc351862354b8ec66b2045a Mon Sep 17 00:00:00 2001 From: Christian Hudon Date: Tue, 18 Aug 2015 21:04:43 -0400 Subject: [PATCH] Beginning of igh-level tests for pickling. --- patsy/test_pickling.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 patsy/test_pickling.py diff --git a/patsy/test_pickling.py b/patsy/test_pickling.py new file mode 100644 index 0000000..8f2cc9a --- /dev/null +++ b/patsy/test_pickling.py @@ -0,0 +1,22 @@ +from six.moves import cPickle as pickle + +from patsy import EvalFactor + +stuff = [ + EvalFactor("a+b"), + ] + +def test_pickling_roundtrips(): + for obj in stuff: + assert obj == pickle.loads(pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)) + +def test_unpickling_future_gives_sensible_error_msg(): + pass + +# Entrypoint: python -m patsy.test_pickling ... + +if __name__ == "__main__": + # TODO Save pickle. Make sure it's running from the right directory, so + # the pickles are saved in the right place. + +