tolerate UnsupportedOperation in _winconsole._is_console()
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* On Windows, calling 'f.fileno()' in '_winconsole._is_console()' may raise UnsupportedOperation, for example when the pytest 'capsys' fixture is used which captures stdout for testing purposes. This change tolerates that exception and treats it as False. * Added a testcase test_echo_with_capsys() where the output of click.echo() is captured using the pytest capsys fixture.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
Diff stats
3 files+9 added−1 removed
- tests:+6 added−0 removed
- other:+3 added−1 removed