summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gdb.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-29 21:31:35 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-29 21:31:35 (GMT)
commit65c66ab2559256b5b3a1e2dd8ef9679121e3de64 (patch)
treed469b2c08a57d476852c48205962f62ad78ce8db /Lib/test/test_gdb.py
parent9f5db07dab9a2f7f82e6e2763bfdb866ee0c1be3 (diff)
downloadcpython-65c66ab2559256b5b3a1e2dd8ef9679121e3de64.zip
cpython-65c66ab2559256b5b3a1e2dd8ef9679121e3de64.tar.gz
cpython-65c66ab2559256b5b3a1e2dd8ef9679121e3de64.tar.bz2
make gdb skip expected
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r--Lib/test/test_gdb.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index bac8d36..55597ce 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -9,9 +9,8 @@ import subprocess
import sys
import unittest
import locale
-import sysconfig
-from test.support import run_unittest, findfile
+from test.support import run_unittest, findfile, python_is_optimized
try:
gdb_version, _ = subprocess.Popen(["gdb", "--version"],
@@ -665,15 +664,8 @@ 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")
-
+ if python_is_optimized():
+ raise unittest.SkipTest("Python was compiled with optimizations")
run_unittest(PrettyPrintTests,
PyListTests,
StackNavigationTests,