diff options
Diffstat (limited to 'Lib/test/test_capi.py')
-rw-r--r-- | Lib/test/test_capi.py | 10 |
1 files changed, 7 insertions, 3 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): |