diff --git a/testing/conftest.py b/testing/conftest.py index 8e77fcae5..2a3ce5203 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -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.