bpo-44821: Eagerly assign __dict__ for new objects. (GH-27589)

This commit is contained in:
Mark Shannon 2021-08-04 16:41:14 +01:00 committed by GitHub
parent c83919bd63
commit cee67fa661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 8 deletions

View file

@ -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):