瀏覽代碼

Set COLUMNS & LINES as if it was a terminal

Abogical 8 年之前
父節點
當前提交
1362d2e90f
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/borg/testsuite/helpers.py

+ 2 - 0
src/borg/testsuite/helpers.py

@@ -904,6 +904,8 @@ def test_yes_env_output(capfd, monkeypatch):
 
 
 
 
 def test_progress_percentage_sameline(capfd):
 def test_progress_percentage_sameline(capfd):
+    os.environ['COLUMNS'] = '4'
+    os.environ['LINES'] = '1'
     pi = ProgressIndicatorPercent(1000, step=5, start=0, msg="%3.0f%%")
     pi = ProgressIndicatorPercent(1000, step=5, start=0, msg="%3.0f%%")
     pi.logger.setLevel('INFO')
     pi.logger.setLevel('INFO')
     pi.show(0)
     pi.show(0)