fix: TkProgressTqdm Typ-Signatur und Test-Isolation verbessert
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user