[3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224)

gh-110178: Use fewer weakrefs in test_typing.py (GH-110194)

Confirmed that without the C changes from GH-108517, this test still segfaults with only 10 weakrefs.
(cherry picked from commit 732ad44cec)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-10-02 10:15:30 -07:00 committed by GitHub
parent 8296b53027
commit 46e69576a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -550,7 +550,7 @@ class TypeVarTests(BaseTestCase):
with self.subTest(cls=cls): with self.subTest(cls=cls):
vals = weakref.WeakValueDictionary() vals = weakref.WeakValueDictionary()
for x in range(100000): for x in range(10):
vals[x] = cls(str(x)) vals[x] = cls(str(x))
del vals del vals