Skip to content
Myr

Skip some tests on Windows

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kevin Deldycke · committed by Kevin Deldycke · parent 98302ac · Browse files · 1 file+17 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−5 removed

  • tests:+17 added−5 removed

1 file+17 added−5 removed

modified:tests/test_termui.py+17 added-5 removed
624 unmodified lines
625 assert shlex.split(pager_env) == expected_parts626627628def _get_real_pager_command() -> str:629 """Return a platform pager used to exercise the BinaryIO pager branch."""630 pager_name = "more" if WIN else "cat"631 pager_path = shutil.which(pager_name)632 assert pager_path is not None, f"{pager_name} not available"629 """Return a real pager binary path used to exercise the pipe pager branch.630631 ..warning::632 Unix-only for now: ``more.com`` on Windows is interactive and goes633 through ``_tempfilepager`` rather than ``_pipepager``.634 """635 pager_path = shutil.which("cat")636 assert pager_path is not None, "cat not available"637 return pager_path638639640def _run_get_pager_file_with_real_pager(monkeypatch, capfd, writer, color=False):
17 unmodified lines
658 click.echo("middle", file=pager)659 pager.write("suffix\n")660661662@pytest.mark.skipif(663 WIN,664 reason="Exercises the pipe pager path; Windows uses _tempfilepager.",665)666@pytest.mark.parametrize(667 ("writer", "color", "expected"),668 [669 pytest.param(
22 unmodified lines
692)693def test_get_pager_file_with_real_pager_binary_stream(694 monkeypatch, capfd, writer, color, expected695):688 """A real pager should exercise the BinaryIO branch on Unix and Windows."""696 """A real pager should exercise the BinaryIO branch."""697 output = _run_get_pager_file_with_real_pager(698 monkeypatch, capfd, writer, color=color699 )700701 assert output == expected702703704@pytest.mark.skipif(705 WIN,706 reason="Exercises the pipe pager path; Windows uses _tempfilepager.",707)708@pytest.mark.parametrize(709 ("color", "expected"),710 [711 pytest.param(False, "hello\n", id="strip ansi"),
763 unmodified lines