This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Test failures with -OO
Type: Stage:
Components: Tests Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, michael.foord, r.david.murray
Priority: normal Keywords: patch

Created on 2010-09-27 22:26 by michael.foord, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pdb.diff michael.foord, 2010-09-27 22:47
Messages (4)
msg117485 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-09-27 22:26
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.
msg117489 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-09-27 22:47
Most of the failures are caused by a problem in pdb.

In fact, if you run Python with -OO you can't even *import* pdb.

The attached patch fixes that problem (a hasty and untested patch though), and that reduces the number of failures to 5:

5 tests failed:
    test_compileall test_dis test_import test_lib2to3 test_xml_etre
msg118629 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-14 07:14
Fixed pdb issue in r85457.
msg118632 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-14 08:13
r85459 - test_dis
r85460 - test_import
r85461 - test_lib2to3 (bug was in fix_operator)
r85462 - test_xml_etree
r85464 - test_compileall
r85465 - test_cmd_line_script

That should be all of them.
History
Date User Action Args
2022-04-11 14:57:06adminsetgithub: 54173
2010-10-14 08:13:47georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg118632
2010-10-14 07:14:44georg.brandlsetmessages: + msg118629
2010-09-27 22:47:30michael.foordsetfiles: + pdb.diff

nosy: + georg.brandl
messages: + msg117489

keywords: + patch
2010-09-27 22:26:59michael.foordcreate