diff --git a/tests/test_download_progress.py b/tests/test_download_progress.py index 511cbc5..ecc0494 100644 --- a/tests/test_download_progress.py +++ b/tests/test_download_progress.py @@ -7,6 +7,9 @@ from whisper_local.tray._download_progress import TkProgressTqdm class TestTkProgressTqdm: + def teardown_method(self): + TkProgressTqdm._queue = None + def test_update_puts_message_in_queue(self): q = queue.Queue() TkProgressTqdm._queue = q diff --git a/whisper_local/tray/_download_progress.py b/whisper_local/tray/_download_progress.py index 37b558f..3b6d055 100644 --- a/whisper_local/tray/_download_progress.py +++ b/whisper_local/tray/_download_progress.py @@ -20,7 +20,9 @@ class TkProgressTqdm(tqdm_module.tqdm): self._accumulated_n = 0 super().__init__(*args, **kwargs) - def update(self, n: int = 1) -> bool | None: + def update(self, n: int | float | None = 1) -> bool | None: + if n is None: + n = 0 self._accumulated_n += n result = super().update(n) if self._queue is not None: