Skip to content

Commit 2044787

Browse files
test(cliparser): explicitly set output width to 80 during tests
1 parent 7f39c21 commit 2044787

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test_cliparser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import sys
23
import unittest
34
from contextlib import contextmanager
@@ -274,11 +275,15 @@
274275
def captured_output():
275276
new_out, new_err = StringIO(), StringIO()
276277
old_out, old_err = sys.stdout, sys.stderr
278+
old_environ = dict(os.environ)
279+
os.environ["COLUMNS"] = "80"
277280
try:
278281
sys.stdout, sys.stderr = new_out, new_err
279282
yield sys.stdout, sys.stderr
280283
finally:
281284
sys.stdout, sys.stderr = old_out, old_err
285+
os.environ.clear()
286+
os.environ.update(old_environ)
282287

283288

284289
class CliParserTest(unittest.TestCase):

0 commit comments

Comments
 (0)