Skip to content

Commit

Permalink
Force terminal width when running tests (#11425) (#11432)
Browse files Browse the repository at this point in the history
Related to #11423

(cherry picked from commit 241f2a8)
  • Loading branch information
nicoddemus committed Sep 11, 2023
1 parent 1944dc0 commit f8bb857
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testing/conftest.py
Expand Up @@ -21,6 +21,15 @@ def restore_tracing():
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.
Expand Down

0 comments on commit f8bb857

Please sign in to comment.