Skip to content

Commit

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

(cherry picked from commit 241f2a8)
  • Loading branch information
nicoddemus committed Sep 11, 2023
1 parent 1944dc0 commit 5087708
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 5087708

Please sign in to comment.