From b2245bf5b6c4e83a502bafeef6f7488c65616827 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Tue, 9 Feb 2021 17:49:33 +0000 Subject: [PATCH] tests: add disabled repr, misc docstrings --- tests/tests_tqdm.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/tests_tqdm.py b/tests/tests_tqdm.py index 65b2c6ad..dc23b2b8 100644 --- a/tests/tests_tqdm.py +++ b/tests/tests_tqdm.py @@ -1425,7 +1425,7 @@ def test_clear(): def test_clear_disabled(): - """Test clearing bar display""" + """Test disabled clear""" with closing(StringIO()) as our_file: with tqdm(total=10, file=our_file, desc='pos0 bar', disable=True, bar_format='{l_bar}') as t: @@ -1454,8 +1454,19 @@ def test_refresh(): assert after == [u'pos0 bar: 10%|', u'pos1 bar: 10%|'] +def test_disabled_repr(capsys): + """Test disabled repr""" + with tqdm(total=10, disable=True) as t: + str(t) + t.update() + print(t) + out, err = capsys.readouterr() + assert not err + assert out == ' 0%| | 0/10 [00:00