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.

Title: Some doctest-based tests fail when run with python -OO
Type: Stage: resolved
Components: Tests Versions: Python 2.7
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, serhiy.storchaka
Priority: normal Keywords: buildbot

Created on 2013-02-03 09:27 by ned.deily, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg181253 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-02-03 09:27
Seen on the AMD64 Mountain Lion Optimized [SB] 2.7 buildbot

test test_doctest crashed -- <type 'exceptions.AssertionError'>: filter ('backquote not supported', SyntaxWarning) did not catch any warning
Traceback (most recent call last):
  File "./Lib/test/", line 896, in runtest_inner
  File "/Users/cpython/buildslave/optimized/2.7.snakebite-mountainlion-amd64-optimized/build/Lib/test/", line 2684, in test_main
    test_support.run_doctest(test_doctest, verbosity=True)
  File "/Users/cpython/buildslave/optimized/2.7.snakebite-mountainlion-amd64-optimized/build/Lib/", line 24, in __exit__
  File "/Users/cpython/buildslave/optimized/2.7.snakebite-mountainlion-amd64-optimized/build/Lib/test/", line 641, in _filterwarnings
AssertionError: filter ('backquote not supported', SyntaxWarning) did not catch any warning

The same failure is seen in test_syntax and test_zipimport_support.

That buildbot builds the interpreter --with-pydebug but runs the test suite with -OO:

./python.exe -Wd -3 -E -tt -OO -R ./Lib/test/ -uall -rwW

I am able to reproduce the buildbot failures when run as above.  Without "-OO", the tests no longer fail.
msg181254 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-03 09:34
Without -3 option tests passed.
msg370430 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-31 12:50
Python 2.7 is no longer supported.
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61314
2020-05-31 12:50:42serhiy.storchakasetstatus: open -> closed
resolution: out of date
messages: + msg370430

stage: resolved
2013-02-03 09:34:35serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg181254
2013-02-03 09:27:28ned.deilycreate