[issue9964] Test failures with -OO

Michael Foord report at bugs.python.org
Tue Sep 28 00:27:00 CEST 2010


New submission from Michael Foord <michael at voidspace.org.uk>:

When I run the test suite (py3k branch) with -OO I get 42 failures. Most of these look like they are caused by the same (or a similar) problem (attempting to run doctests from now-non-existent docstrings).

The tests that fail are:

When I run with -OO I get 42 test failures. Most of them look like they are due to missing docstrings but some are likely to be due to missing asserts.

42 tests failed:
    test_bisect test_cmd test_code test_collections test_compileall
    test_ctypes test_decimal test_deque test_descrtut test_dictcomps
    test_difflib test_dis test_distutils test_doctest test_extcall
    test_generators test_genexps test_getopt test_http_cookies
    test_import test_itertools test_json test_lib2to3 test_listcomps
    test_math test_metaclass test_pdb test_pickle test_pickletools
    test_pyclbr test_setcomps test_syntax test_threading_local
    test_tokenize test_unpack test_unpack_ex test_urllib2 test_weakref
    test_xml_etree test_xml_etree_c test_zipimport
    test_zipimport_support

Typical tracebacks (one explicitly calling doctest code, the other through test.support):

Traceback (most recent call last):
  File "Lib/test/test_collections.py", line 3, in <module>
    import unittest, doctest, operator
  File "/compile/py3k/Lib/doctest.py", line 97, in <module>
    import unittest, difflib, pdb, tempfile
  File "/compile/py3k/Lib/pdb.py", line 1348, in <module>
    __doc__ += getattr(Pdb, 'do_' + _command).__doc__.strip() + '\n\n'
AttributeError: 'NoneType' object has no attribute 'strip'

Traceback (most recent call last):
  File "Lib/test/test_code.py", line 169, in <module>
    test_main()
  File "Lib/test/test_code.py", line 164, in test_main
    run_doctest(test_code, verbose)
  File "/compile/py3k/Lib/test/support.py", line 1142, in run_doctest
    import doctest
  File "/compile/py3k/Lib/doctest.py", line 97, in <module>
    import unittest, difflib, pdb, tempfile
  File "/compile/py3k/Lib/pdb.py", line 1348, in <module>
    __doc__ += getattr(Pdb, 'do_' + _command).__doc__.strip() + '\n\n'
AttributeError: 'NoneType' object has no attribute 'strip'


Issue 6292 was previously closed when all tests ran successfully with -OO, so this is a more recent regression.

----------
components: Tests
messages: 117485
nosy: michael.foord, r.david.murray
priority: normal
severity: normal
status: open
title: Test failures with -OO
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9964>
_______________________________________


More information about the Python-bugs-list mailing list