Skip to content

Commit

Permalink
Force terminal width when running tests (#11425)
Browse files Browse the repository at this point in the history
Related to #11423
  • Loading branch information
nicoddemus committed Sep 11, 2023
1 parent 39f9306 commit 241f2a8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions testing/conftest.py
Expand Up @@ -22,6 +22,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(wrapper=True, tryfirst=True)
def pytest_collection_modifyitems(items) -> Generator[None, None, None]:
"""Prefer faster tests.
Expand Down

0 comments on commit 241f2a8

Please sign in to comment.