diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-02-05 04:08:07 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-02-05 04:08:07 (GMT) |
commit | 35ad641b9931691d2b0371ee3a6fb57b59256dbd (patch) | |
tree | f47196b01377bb05c656746641563ef0f32528d7 /Lib/test/test_datetime.py | |
parent | 6288e230d8a6d3de89eda2371115208fcea5573f (diff) | |
download | cpython-35ad641b9931691d2b0371ee3a6fb57b59256dbd.zip cpython-35ad641b9931691d2b0371ee3a6fb57b59256dbd.tar.gz cpython-35ad641b9931691d2b0371ee3a6fb57b59256dbd.tar.bz2 |
Build pickler_choices list in a lazier way.
Diffstat (limited to 'Lib/test/test_datetime.py')
-rw-r--r-- | Lib/test/test_datetime.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index 693b98e..d174f69 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -16,22 +16,11 @@ from datetime import tzinfo from datetime import time from datetime import date, datetime - -pickle_choices = [ - (pickle, pickle, 0), - (pickle, pickle, 1), - (pickle, pickle, 2), - (cPickle, cPickle, 0), - (cPickle, cPickle, 1), - (cPickle, cPickle, 2), - (pickle, cPickle, 0), - (pickle, cPickle, 1), - (pickle, cPickle, 2), - (cPickle, pickle, 0), - (cPickle, pickle, 1), - (cPickle, pickle, 2), - ] - +pickle_choices = [(pickler, unpickler, proto) + for pickler in pickle, cPickle + for unpickler in pickle, cPickle + for proto in range(3)] +assert len(pickle_choices) == 2*2*3 # XXX The test suite uncovered a bug in Python 2.2.2: if x and y are # XXX instances of new-style classes (like date and time) that both |