bpo-40019: Skip test_gdb if Python was optimized (GH-19081)

test_gdb now skips tests if it detects that gdb failed to read debug
information because the Python binary is optimized.
This commit is contained in:
Victor Stinner 2020-03-20 08:23:26 +01:00 committed by GitHub
parent a36adfa6bb
commit 7bf069b611
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 7 deletions

View file

@ -230,6 +230,15 @@ class DebuggerTests(unittest.TestCase):
" because the Program Counter is"
" not present")
# bpo-40019: Skip the test if gdb failed to read debug information
# because the Python binary is optimized.
for pattern in (
'(frame information optimized out)',
'Unable to read information on python frame',
):
if pattern in out:
raise unittest.SkipTest(f"{pattern!r} found in gdb output")
return out
def get_gdb_repr(self, source,