You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the tests are run in Python's non-interactive mode we don't expect
readline to be imported. Unfortunately it manages to sneak in on the
latest Python. In Python 3.13.0 pdb now imports rlcompleter to standardise
its command-line completion (see python/cpython#112948). This is fine, but
pytest also imports pdb as part of its configuration as it wants to monkey
patch it in `pytest/src/_pytest/debugging.py`...
This causes readline to be imported before test.py is imported, thwarting
the `import_alternative_readline_module` function.
The solution is to clear any preloaded readline modules at the start
of the unit test by hacking it out of `sys.modules`.
0 commit comments