fix: TkProgressTqdm Typ-Signatur und Test-Isolation verbessert

This commit is contained in:
2026-04-12 12:29:34 +02:00
parent e92f5f59fb
commit 44c8d8ed84
2 changed files with 6 additions and 1 deletions
+3
View File
@@ -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
+3 -1
View File
@@ -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: