pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/145788

ssets/global-68dd150ce6c8e711.css" /> gh-145492: fix regression test for defaultdict factory repr by KowalskiThomas · Pull Request #145788 · python/cpython · GitHub
Skip to content

gh-145492: fix regression test for defaultdict factory repr#145788

Merged
encukou merged 1 commit intopython:mainfrom
KowalskiThomas:kowalski/test-fix-regression-test-for-defaultdict-factory-repr
Mar 11, 2026
Merged

gh-145492: fix regression test for defaultdict factory repr#145788
encukou merged 1 commit intopython:mainfrom
KowalskiThomas:kowalski/test-fix-regression-test-for-defaultdict-factory-repr

Conversation

@KowalskiThomas
Copy link
Contributor

@KowalskiThomas KowalskiThomas commented Mar 10, 2026

What is this PR?

This PR fixes the regression test introduced in #145761 and that did not properly reproduce the issue.

Running the test without the repr changes now properly crashes.

% ./python.exe -m unittest test.test_defaultdict
..........E..
======================================================================
ERROR: test_repr_recursive_factory (test.test_defaultdict.TestDefaultDict.test_repr_recursive_factory)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/thomas.kowalski/Documents/cpython/Lib/test/test_defaultdict.py", line 219, in test_repr_recursive_factory
    r = repr(dd)
  File "/Users/thomas.kowalski/Documents/cpython/Lib/test/test_defaultdict.py", line 215, in __repr__
    return f"ProblematicFactory for {dd}"
                                    ^^^^
  File "/Users/thomas.kowalski/Documents/cpython/Lib/test/test_defaultdict.py", line 215, in __repr__
    return f"ProblematicFactory for {dd}"
                                    ^^^^
  File "/Users/thomas.kowalski/Documents/cpython/Lib/test/test_defaultdict.py", line 215, in __repr__
    return f"ProblematicFactory for {dd}"
                                    ^^^^
  [Previous line repeated 981 more times]
RecursionError: maximum recursion depth exceeded

----------------------------------------------------------------------
Ran 13 tests in 1.742s

gh-145492

@YvesDup
Copy link
Contributor

YvesDup commented Mar 11, 2026

This fix looks good to me ;)

@encukou encukou merged commit aa4240e into python:main Mar 11, 2026
51 checks passed
@encukou
Copy link
Member

encukou commented Mar 11, 2026

Thank you!

encukou pushed a commit to miss-islington/cpython that referenced this pull request Mar 11, 2026
encukou pushed a commit to miss-islington/cpython that referenced this pull request Mar 11, 2026
@KowalskiThomas
Copy link
Contributor Author

I guess we should backport the non-regression test as well?

encukou pushed a commit that referenced this pull request Mar 12, 2026
) (GH-145747)

(cherry picked from commit 2d35f9b)

Includes test fix-up from GH-145788
(cherry picked from commit aa4240e)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
encukou pushed a commit that referenced this pull request Mar 12, 2026
) (GH-145746)

(cherry picked from commit 2d35f9b)

Includes test fix-up from GH-145788
(cherry picked from commit aa4240e)

Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
@encukou
Copy link
Member

encukou commented Mar 12, 2026

Yes, I included it in the backports :)

@KowalskiThomas
Copy link
Contributor Author

Great, thank you! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy