Skip to content

Commit 91ed1c2

Browse files
committed
Fix running test_source_cli with unusual COLUMNS values
Tests expect help text to be wrapped at 80 characters. Issue: #463
1 parent b2c979c commit 91ed1c2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,15 @@ def docs_test_env():
8282
yield setenv
8383

8484
setenv.clear()
85+
86+
87+
@pytest.fixture
88+
def cli_test_env():
89+
setenv = SetEnv()
90+
91+
# envs for reproducible cli tests
92+
setenv.set('COLUMNS', '80')
93+
94+
yield setenv
95+
96+
setenv.clear()

tests/test_source_cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
ARGPARSE_OPTIONS_TEXT = 'options' if sys.version_info >= (3, 10) else 'optional arguments'
4545

4646

47+
@pytest.fixture(autouse=True)
48+
def cli_test_env_autouse(cli_test_env):
49+
pass
50+
51+
4752
def foobar(a, b, c=4):
4853
pass
4954

0 commit comments

Comments
 (0)