reedline
reedline copied to clipboard
Impossible testing with pexpect
Platform linux Terminal software pseudo terminal - python pty
I'm trying to write integration tests of reedline app with python pexpect lib, and, unfortunately, it's fail. Looks like problem in crossterm, but I'm not sure.
Steps to reproduce
This can be reproduced on basic example:
>>> import pexpect
>>> proc = pexpect.spawn("./target/debug/examples/basic")
>>> print(proc.readline())
b'\x1b[6nError: Custom { kind: Other, error: "The cursor position could not be read within a normal duration" }\r\n'
Would love to see if we can handle the absence of certain behaviors of a proper terminal more gracefully. Being able to test reedline end-to-end would be very welcome.
There seems to be a related limitation if we block as soon as we assume there is no full TTY connected https://github.com/nushell/nushell/issues/9497