summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-03-31 17:27:41 (GMT)
committerGitHub <noreply@github.com>2020-03-31 17:27:41 (GMT)
commit4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc (patch)
tree6d5ddea8970506ff22cf79453ccc848dfeef2d3a /Lib/test
parentfb6e04b5f10086194bcc77d571f77cb30873998b (diff)
downloadcpython-4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc.zip
cpython-4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc.tar.gz
cpython-4ced9a7611ddfd923bd8f72aa61121d0e5aeb8fc.tar.bz2
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. (cherry picked from commit 7bf069b6110278102c8f4719975a5eb5a5af25f9) Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_gdb.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index e106033..bd9a5cb 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -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,