Skip to content

Commit 241f2a8

Browse files
authored
Force terminal width when running tests (#11425)
Related to #11423
1 parent 39f9306 commit 241f2a8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

testing/conftest.py

+9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ def restore_tracing():
2222
sys.settrace(orig_trace)
2323

2424

25+
@pytest.fixture(autouse=True)
26+
def set_column_width(monkeypatch: pytest.MonkeyPatch) -> None:
27+
"""
28+
Force terminal width to 80: some tests check the formatting of --help, which is sensible
29+
to terminal width.
30+
"""
31+
monkeypatch.setenv("COLUMNS", "80")
32+
33+
2534
@pytest.hookimpl(wrapper=True, tryfirst=True)
2635
def pytest_collection_modifyitems(items) -> Generator[None, None, None]:
2736
"""Prefer faster tests.

0 commit comments

Comments
 (0)