]> granicus.if.org Git - python/commitdiff
Build pickler_choices list in a lazier way.
authorTim Peters <tim.peters@gmail.com>
Wed, 5 Feb 2003 04:08:07 +0000 (04:08 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 5 Feb 2003 04:08:07 +0000 (04:08 +0000)
Lib/test/test_datetime.py

index 693b98eaebc44ce43d930e117400792e94cbff66..d174f69dbca45417454a1ffdbcd0c3208cb4af24 100644 (file)
@@ -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