Skip to content

Commit c6ee3f5

Browse files
committed
Use custom stream for Windows compatibility in tests.
1 parent e4d4f3c commit c6ee3f5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,10 @@ def test_echo_color_flag_atty_and_not_jupyter_kernel(
280280
styled_text = click.style(text, fg="red")
281281
assert styled_text == stylized_text
282282

283-
click.echo(styled_text, color=color)
283+
stream = StringIO()
284+
click.echo(styled_text, color=color, file=stream)
284285
out, err = capfd.readouterr()
285-
assert out == expected
286+
assert stream.getvalue() == expected
286287

287288

288289
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)