From be9be38381109868d1454d1bf6a5cdc2aa4c1f17 Mon Sep 17 00:00:00 2001 From: v4rgas <66626747+v4rgas@users.noreply.github.com> Date: Wed, 14 May 2025 17:16:39 -0400 Subject: [PATCH] 6a176116-6109-413e-b2e1-f6bc724f4836 --- tqdm_4/tqdm/_tqdm.py | 3 +-- tqdm_4/tqdm/tests/tests_tqdm.py | 9 --------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/tqdm_4/tqdm/_tqdm.py b/tqdm_4/tqdm/_tqdm.py index ea58409..df6414e 100755 --- a/tqdm_4/tqdm/_tqdm.py +++ b/tqdm_4/tqdm/_tqdm.py @@ -320,8 +320,7 @@ def format_meter(n, total, elapsed, ncols=None, prefix='', ascii=False, # apply custom scale if necessary if unit_scale and unit_scale not in (True, 1): - if total: - total *= unit_scale + total *= unit_scale n *= unit_scale if rate: rate *= unit_scale # by default rate = 1 / self.avg_time diff --git a/tqdm_4/tqdm/tests/tests_tqdm.py b/tqdm_4/tqdm/tests/tests_tqdm.py index f39218d..9ea573b 100644 --- a/tqdm_4/tqdm/tests/tests_tqdm.py +++ b/tqdm_4/tqdm/tests/tests_tqdm.py @@ -772,15 +772,6 @@ def test_infinite_total(): pass -@with_setup(pretest, posttest) -def test_nototal(): - """Test unknown total length""" - with closing(StringIO()) as our_file: - for i in tqdm((i for i in range(10)), file=our_file, unit_scale=10): - pass - assert "100it" in our_file.getvalue() - - @with_setup(pretest, posttest) def test_unit(): """Test SI unit prefix"""