Force terminal width when running tests (#11425) (#11432)

Related to #11423

(cherry picked from commit 241f2a890e)
This commit is contained in:
Bruno Oliveira 2023-09-11 09:48:22 -03:00 committed by GitHub
parent 1944dc06d3
commit f8bb8572fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,15 @@ if sys.gettrace():
sys.settrace(orig_trace)
@pytest.fixture(autouse=True)
def set_column_width(monkeypatch: pytest.MonkeyPatch) -> None:
"""
Force terminal width to 80: some tests check the formatting of --help, which is sensible
to terminal width.
"""
monkeypatch.setenv("COLUMNS", "80")
@pytest.hookimpl(hookwrapper=True, tryfirst=True)
def pytest_collection_modifyitems(items):
"""Prefer faster tests.