I did not encounter a problem due to this, but I found inconsistencies in the code.
Actual Behavior
The tuple yielded by the CliRunner.isolation() contextmanager is incompatible with the
usage in the CliRunner.invoke() method.
In the latter, a BytesIO object is assumed, while the actual return value is a boolean (literal).
I did not encounter a problem due to this, but I found inconsistencies in the code.
Actual Behavior
The tuple yielded by the
CliRunner.isolation()
contextmanager is incompatible with the usage in theCliRunner.invoke()
method. In the latter, aBytesIO
object is assumed, while the actual return value is a boolean (literal).https://github.com/pallets/click/blob/fbe33bac440d0edef50fc980fb638d2dbbf96b5e/src/click/testing.py#L265
https://github.com/pallets/click/blob/fbe33bac440d0edef50fc980fb638d2dbbf96b5e/src/click/testing.py#L370
I guess the intent was to only return the BytesIO when
self.mix_stderr
is True, So I'd rather bind bytes_error as None before and just pass itBut I'm unsure of what is expected behaviour here, otherwise I would simply fix it.