summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gdb.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-07-08 18:51:30 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-07-08 18:51:30 (GMT)
commitf48ea7c2a950c81b98c6e689fc51c99598546bb4 (patch)
tree041215f2af83d9d8b5973d73b32d517e0ee43598 /Lib/test/test_gdb.py
parent247900ce47fc4f239d9c4b829fe0eb07096508bc (diff)
downloadcpython-f48ea7c2a950c81b98c6e689fc51c99598546bb4.zip
cpython-f48ea7c2a950c81b98c6e689fc51c99598546bb4.tar.gz
cpython-f48ea7c2a950c81b98c6e689fc51c99598546bb4.tar.bz2
Issue #8605: Skip test_gdb if Python is compiled with optimizations.
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r--Lib/test/test_gdb.py10
1 files changed, 10 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,