Skip to content
Myr

✅ Monkeypatch console width to allow running `pytest` directly (#1542)

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

* Fix help tests failing due to terminal width wrapping * Use monkeypatch to fix terminal width in help tests * 🎨 Auto format * Remove empty line * Clean up * Add inline comment ---------

authored by Swaati Raveendra · committed by GitHub · parent fc20e31 · Browse files · 1 file+3 added−1 removed
This commit

State

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

Trailers

  • Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

Diff stats

1 file+3 added−1 removed

  • tests:+3 added−1 removed

1 file+3 added−1 removed

modified:tests/test_tutorial/test_options/test_help/test_tutorial004.py+3 added-1 removed
26 unmodified lines
27 assert result.exit_code == 028 assert "Hello Wade Wilson" in result.output293031def test_help(mod: ModuleType):31def test_help(monkeypatch, mod: ModuleType):32 # avoid default width of 80 for non-attached consoles during testing33 monkeypatch.setenv("COLUMNS", "200")34 result = runner.invoke(mod.app, ["--help"])35 assert result.exit_code == 036 assert "--fullname" in result.output37 assert "TEXT" in result.output
10 unmodified lines