Skip to content

Commit 3f25640

Browse files
SwaatiRpre-commit-ci-lite[bot]svlandeg
authored
✅ Monkeypatch console width to allow running pytest directly (#1542)
* 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 --------- 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>
1 parent fc20e31 commit 3f25640

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test_tutorial/test_options/test_help/test_tutorial004.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def test_call(mod: ModuleType):
2828
assert "Hello Wade Wilson" in result.output
2929

3030

31-
def test_help(mod: ModuleType):
31+
def test_help(monkeypatch, mod: ModuleType):
32+
# avoid default width of 80 for non-attached consoles during testing
33+
monkeypatch.setenv("COLUMNS", "200")
3234
result = runner.invoke(mod.app, ["--help"])
3335
assert result.exit_code == 0
3436
assert "--fullname" in result.output

0 commit comments

Comments
 (0)