diff options
author | Mark Shannon <mark@hotpy.org> | 2021-08-04 15:41:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 15:41:14 (GMT) |
commit | cee67fa66129b5d1db5c8aa3884338f82f0da3de (patch) | |
tree | 079f04f5ba63c5cbd2133c7ada636d28e117ff18 /Lib/test/test_capi.py | |
parent | c83919bd635f4433f1c6ae8504996a9fe3c215e5 (diff) | |
download | cpython-cee67fa66129b5d1db5c8aa3884338f82f0da3de.zip cpython-cee67fa66129b5d1db5c8aa3884338f82f0da3de.tar.gz cpython-cee67fa66129b5d1db5c8aa3884338f82f0da3de.tar.bz2 |
bpo-44821: Eagerly assign __dict__ for new objects. (GH-27589)
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): |