mirror of
https://github.com/python/cpython.git
synced 2025-08-25 11:15:02 +00:00
Quite a few fixes to make the library and test suite more robust when
cPickle cannot be imported. This was necessary because my last mass checkin broke cPickle and I don't feel like debugging it right now; but it seems a good idea in general not to require cPickle when pickle.py is also there. A few unrelated fixes for issues while debigging various test failures. setup.py: disable building of cPickle until I've fixed it Objects/... genobject.c: disallow raising string exceptions Lib/... Cookie.py: fix doctest not to fail if cPickle is missing ctypes/macholib/dyld.py: fix relative imports sqlite3/__init__.py: fix relative import xml/dom/__init__.py: fix relative import Lib/test/... regrtest.py: reduce list of skipped items on darwin test_generators.py: don't test string exceptions; test throw() errors test_traceback.py: don't test string exceptions pickletester.py: don't fail if cPickle is missing test_datetime.py: don't fail if cPickle is missing test_descr.py: don't fail if cPickle is missing (still some other failures) test_exceptions.py: don't fail if cPickle is missing test_re.py: don't fail if cPickle is missing test_array.py: use pickle, not cPickle test_bool.py: don't fail if cPickle is missing test_deque.py: use pickle, not cPickle test_logging.py: use pickle, not cPickle
This commit is contained in:
parent
3b271054d7
commit
bf12cdbb28
18 changed files with 84 additions and 69 deletions
|
@ -5,8 +5,11 @@ See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
|
|||
|
||||
import sys
|
||||
import pickle
|
||||
import cPickle
|
||||
import unittest
|
||||
try:
|
||||
import cPickle
|
||||
except ImportError:
|
||||
cPickle = None
|
||||
|
||||
from test import test_support
|
||||
|
||||
|
@ -18,9 +21,14 @@ from datetime import date, datetime
|
|||
|
||||
pickle_choices = [(pickler, unpickler, proto)
|
||||
for pickler in pickle, cPickle
|
||||
if pickler is not None
|
||||
for unpickler in pickle, cPickle
|
||||
if unpickler is not None
|
||||
for proto in range(3)]
|
||||
assert len(pickle_choices) == 2*2*3
|
||||
if cPickle is None:
|
||||
assert len(pickle_choices) == 3
|
||||
else:
|
||||
assert len(pickle_choices) == 2*2*3
|
||||
|
||||
# An arbitrary collection of objects of non-datetime types, for testing
|
||||
# mixed-type comparisons.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue