summaryrefslogtreecommitdiff
path: root/Lib/test/test_gdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r--Lib/test/test_gdb.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index f157eae..38e570f 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -7,6 +7,7 @@ import os
import re
import subprocess
import sys
+import sysconfig
import unittest
import sysconfig
@@ -23,6 +24,7 @@ def get_gdb_version():
try:
proc = subprocess.Popen(["gdb", "-nx", "--version"],
stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
universal_newlines=True)
version = proc.communicate()[0]
except OSError:
@@ -77,6 +79,9 @@ def run_gdb(*args, **env_vars):
).communicate()
return out, err
+if not sysconfig.is_python_build():
+ raise unittest.SkipTest("test_gdb only works on source builds at the moment.")
+
# Verify that "gdb" was built with the embedded python support enabled:
gdbpy_version, _ = run_gdb("--eval-command=python import sys; print(sys.version_info)")
if not gdbpy_version:
@@ -260,6 +265,9 @@ class DebuggerTests(unittest.TestCase):
def get_sample_script(self):
return findfile('gdb_sample.py')
+
+@unittest.skipIf(python_is_optimized(),
+ "Python was compiled with optimizations")
class PrettyPrintTests(DebuggerTests):
def test_getting_backtrace(self):
gdb_output = self.get_stack_trace('print 42')
@@ -712,6 +720,8 @@ $''')
'Unable to find a newer python frame\n')
@unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ @unittest.skipIf(python_is_optimized(),
+ "Python was compiled with optimizations")
def test_up_at_top(self):
'Verify handling of "py-up" at the top of the stack'
bt = self.get_stack_trace(script=self.get_sample_script(),
@@ -772,6 +782,8 @@ Traceback \(most recent call first\):
@unittest.skipUnless(thread,
"Python was compiled without thread support")
+ @unittest.skipIf(python_is_optimized(),
+ "Python was compiled with optimizations")
def test_threads(self):
'Verify that "py-bt" indicates threads that are waiting for the GIL'
cmd = '''