Skip to content

Commit d5ed045

Browse files
committed
Beginning of igh-level tests for pickling.
1 parent 3bc08d6 commit d5ed045

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

patsy/test_pickling.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from six.moves import cPickle as pickle
2+
3+
from patsy import EvalFactor
4+
5+
stuff = [
6+
EvalFactor("a+b"),
7+
]
8+
9+
def test_pickling_roundtrips():
10+
for obj in stuff:
11+
assert obj == pickle.loads(pickle.dumps(obj, pickle.HIGHEST_PROTOCOL))
12+
13+
def test_unpickling_future_gives_sensible_error_msg():
14+
pass
15+
16+
# Entrypoint: python -m patsy.test_pickling ...
17+
18+
if __name__ == "__main__":
19+
# TODO Save pickle. Make sure it's running from the right directory, so
20+
# the pickles are saved in the right place.
21+
22+

0 commit comments

Comments
 (0)