Skip to content

Commit f8bb857

Browse files
authored
Force terminal width when running tests (#11425) (#11432)
Related to #11423 (cherry picked from commit 241f2a8)
1 parent 1944dc0 commit f8bb857

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
@@ -21,6 +21,15 @@ def restore_tracing():
2121
sys.settrace(orig_trace)
2222

2323

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

0 commit comments

Comments
 (0)