mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-44821: Eagerly assign __dict__ for new objects. (GH-27589)
This commit is contained in:
parent
c83919bd63
commit
cee67fa661
6 changed files with 49 additions and 8 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue