summaryrefslogtreecommitdiff
path: root/tests/test_termui.py
diff options
context:
space:
mode:
authorShakil Rafi <shakilrafi0@gmail.com>2020-10-31 22:33:19 -0400
committerGitHub <noreply@github.com>2020-10-31 19:33:19 -0700
commitacc91bc4f47e38f43277fcdfd8ca855734c4fbbc (patch)
treec6d451c6f0e4020b1a3195a62096ac5d01246ea7 /tests/test_termui.py
parenta4763ef93734ccfea497ea10bf0870d588132432 (diff)
downloadclick-acc91bc4f47e38f43277fcdfd8ca855734c4fbbc.tar.gz
skip frequent progress bar renders (#1698)
Diffstat (limited to 'tests/test_termui.py')
-rw-r--r--tests/test_termui.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_termui.py b/tests/test_termui.py
index e199516..956de77 100644
--- a/tests/test_termui.py
+++ b/tests/test_termui.py
@@ -344,6 +344,16 @@ def test_progressbar_update_with_item_show_func(runner, monkeypatch):
assert "Custom 4" in lines[2]
+def test_progress_bar_update_min_steps(runner):
+ bar = _create_progress(update_min_steps=5)
+ bar.update(3)
+ assert bar._completed_intervals == 3
+ assert bar.pos == 0
+ bar.update(2)
+ assert bar._completed_intervals == 0
+ assert bar.pos == 5
+
+
@pytest.mark.parametrize("key_char", ("h", "H", "é", "À", " ", "字", "àH", "àR"))
@pytest.mark.parametrize("echo", [True, False])
@pytest.mark.skipif(not WIN, reason="Tests user-input using the msvcrt module.")