summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_gdb.py10
-rw-r--r--Misc/NEWS2
2 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index e5d1222..bac8d36 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -9,6 +9,7 @@ import subprocess
import sys
import unittest
import locale
+import sysconfig
from test.support import run_unittest, findfile
@@ -664,6 +665,15 @@ class PyLocalsTests(DebuggerTests):
r".*\na = 1\nb = 2\nc = 3\n.*")
def test_main():
+ cflags = sysconfig.get_config_vars()['PY_CFLAGS']
+ final_opt = ""
+ for opt in cflags.split():
+ if opt.startswith('-O'):
+ final_opt = opt
+ if final_opt and final_opt != '-O0':
+ raise unittest.SkipTest("Python was built with compiler optimizations, "
+ "tests can't reliably succeed")
+
run_unittest(PrettyPrintTests,
PyListTests,
StackNavigationTests,
diff --git a/Misc/NEWS b/Misc/NEWS
index 9eede94..4ec9ec9 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1614,6 +1614,8 @@ Documentation
Tests
-----
+- Issue #8605: Skip test_gdb if Python is compiled with optimizations.
+
- Issue #7449: Skip test_socketserver if threading support is disabled
- Issue #8672: Add a zlib test ensuring that an incomplete stream can be