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 | |
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')
-rw-r--r-- | Lib/test/test_capi.py | 10 | ||||
-rw-r--r-- | Lib/test/test_gdb.py | 2 |
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) |