]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-145492: fix regression test for defaultdict factory repr (GH-145788)
authorThomas Kowalski <thom.kowa@gmail.com>
Wed, 11 Mar 2026 13:02:23 +0000 (14:02 +0100)
committerGitHub <noreply@github.com>
Wed, 11 Mar 2026 13:02:23 +0000 (14:02 +0100)
Lib/test/test_defaultdict.py

index 732e9a876ca8adc555fe237651c3989ab2aa8589..a193eb10f16d1784c33dfc0e7e4e01ee1b61c52f 100644 (file)
@@ -212,12 +212,12 @@ class TestDefaultDict(unittest.TestCase):
                 return {}
             def __repr__(self):
                 repr(dd)
-                return "ProblematicFactory()"
+                return f"ProblematicFactory for {dd}"
 
         dd = defaultdict(ProblematicFactory())
         # Should not raise RecursionError
         r = repr(dd)
-        self.assertIn('ProblematicFactory()', r)
+        self.assertIn("ProblematicFactory for", r)
 
 if __name__ == "__main__":
     unittest.main()