Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with -OO #54173

Closed
voidspace opened this issue Sep 27, 2010 · 4 comments
Closed

Test failures with -OO #54173

voidspace opened this issue Sep 27, 2010 · 4 comments
Labels
tests Tests in the Lib/test dir

Comments

@voidspace
Copy link
Contributor

BPO 9964
Nosy @birkenfeld, @bitdancer, @voidspace
Files
  • pdb.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-10-14.08:13:47.355>
    created_at = <Date 2010-09-27.22:26:59.341>
    labels = ['tests']
    title = 'Test failures with -OO'
    updated_at = <Date 2010-10-14.08:13:47.354>
    user = 'https://github.com/voidspace'

    bugs.python.org fields:

    activity = <Date 2010-10-14.08:13:47.354>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-10-14.08:13:47.355>
    closer = 'georg.brandl'
    components = ['Tests']
    creation = <Date 2010-09-27.22:26:59.341>
    creator = 'michael.foord'
    dependencies = []
    files = ['19036']
    hgrepos = []
    issue_num = 9964
    keywords = ['patch']
    message_count = 4.0
    messages = ['117485', '117489', '118629', '118632']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'r.david.murray', 'michael.foord']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue9964'
    versions = ['Python 3.2']

    @voidspace
    Copy link
    Contributor Author

    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'

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

    @voidspace voidspace added the tests Tests in the Lib/test dir label Sep 27, 2010
    @voidspace
    Copy link
    Contributor Author

    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

    @birkenfeld
    Copy link
    Member

    Fixed pdb issue in r85457.

    @birkenfeld
    Copy link
    Member

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants