New submission from STINNER Victor <vstin...@redhat.com>:

Currently, test_gdb fails if gdb logs messages on stderr which are 
"unexpected". I don't understand the rationale for that: Python is not supposed 
to test gdb. It's only supposed to check that python-gdb.py commands work as 
expected: stderr should be ignored.

In the past, I was lazy and just added more and more patterns to ignore on 
stderr, but this approach doesn't work in the long term: gdb evolves 
frequently, and there are always new messages.

Attached PR modify test_gdb to ignore stderr, except of "PC not saved" pattern 
used to skip test_gdb on a special case: bpo-34007.

        # bpo34007: Sometimes some versions of the shared libraries that
        # are part of the traceback are compiled in optimised mode and the
        # Program Counter (PC) is not present, not allowing gdb to walk the
        # frames back. When this happens, the Python bindings of gdb raise
        # an exception, making the test impossible to succeed.
        if "PC not saved" in err:
            raise unittest.SkipTest("gdb cannot walk the frame object"
                                    " because the Program Counter is"
                                    " not present")

----------
components: Tests
messages: 346211
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_gdb must not fail on "unexpected" messages written into stderr
versions: Python 2.7, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37362>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to