cpython
cpython copied to clipboard
gh-70280: allow using custom sys.displayhook's with doctest
This partially reverts patch from https://bugs.python.org/issue8048
Now it's possible to test interactive examples in applications, which use cusomized sys.displayhook, e.g. SymPy, without nasty workarrounds (i.e. overriding the sys.__displayhook__ value before each tests).
This is a restored PR #25651 with minimal changes (internal for a doctest sys.displayhook changes now aren't leaked out).
- Issue: gh-70280
:books: Documentation preview :books:: https://cpython-previews--111871.org.readthedocs.build/