churchyard / rpms / python38

Forked from rpms/python38 5 years ago
Clone
Blob Blame History Raw
diff -up cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise cpython-59223da36dec/Lib/test/test_gdb.py
--- cpython-59223da36dec/Lib/test/test_gdb.py.fix-test_gdb-noise	2012-08-07 06:10:57.000000000 -0400
+++ cpython-59223da36dec/Lib/test/test_gdb.py	2012-08-07 17:13:46.592343113 -0400
@@ -115,6 +115,15 @@ class DebuggerTests(unittest.TestCase):
         # Generate a list of commands in gdb's language:
         commands = ['set breakpoint pending yes',
                     'break %s' % breakpoint,
+
+                    # GDB as of Fedora 17 onwards can distinguish between the
+                    # value of a variable at entry vs current value:
+                    #   http://sourceware.org/gdb/onlinedocs/gdb/Variables.html
+                    # which leads to the selftests failing with errors like this:
+                    #   AssertionError: 'v@entry=()' != '()'
+                    # Disable this:
+                    'set print entry-values no',
+
                     'run']
         if cmds_after_breakpoint:
             commands += cmds_after_breakpoint
@@ -154,8 +163,16 @@ class DebuggerTests(unittest.TestCase):
         err = err.replace("warning: Cannot initialize thread debugging"
                           " library: Debugger service failed\n",
                           '')
-
+        err = '\n'.join([line
+                         for line in err.splitlines()
+                         if not line.startswith('warning: Unable to open')
+                         if not line.startswith('Missing separate debuginfo for')
+                         if not line.startswith('Try: yum --disablerepo=')
+                         # In case 'set print entry-values no' failed:
+                         if not line.startswith('Undefined set print command')])
+ 
         # Ensure no unexpected error messages:
+        self.maxDiff = None
         self.assertEqual(err, '')
         return out