summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_capi.py10
-rw-r--r--Lib/test/test_gdb.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 169e7ac..9165f45 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -323,9 +323,13 @@ class CAPITest(unittest.TestCase):
break
"""
rc, out, err = assert_python_ok('-c', code)
- self.assertIn(b'MemoryError 1', out)
- self.assertIn(b'MemoryError 2 20', out)
- self.assertIn(b'MemoryError 3 30', out)
+ lines = out.splitlines()
+ for i, line in enumerate(lines, 1):
+ self.assertIn(b'MemoryError', out)
+ *_, count = line.split(b' ')
+ count = int(count)
+ self.assertLessEqual(count, i*5)
+ self.assertGreaterEqual(count, i*5-1)
def test_mapping_keys_values_items(self):
class Mapping1(dict):
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 7bdef25..98b36d6 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -566,7 +566,7 @@ id(foo)''')
# http://bugs.python.org/issue8032#msg100537 )
gdb_repr, gdb_output = self.get_gdb_repr('id(__builtins__.help)', import_site=True)
- m = re.match(r'<_Helper at remote 0x-?[0-9a-f]+>', gdb_repr)
+ m = re.match(r'<_Helper\(\) at remote 0x-?[0-9a-f]+>', gdb_repr)
self.assertTrue(m,
msg='Unexpected rendering %r' % gdb_repr)