fix: use mock.patch on total_tqdm patch

pull/753/head
Dowon 2025-02-18 23:01:44 +09:00
parent 06100063b3
commit 941b7c7dfb
No known key found for this signature in database
GPG Key ID: 9CCE5CDC08E34AD0
1 changed files with 1 additions and 5 deletions

View File

@ -49,12 +49,8 @@ def disable_safe_unpickle():
@contextmanager @contextmanager
def pause_total_tqdm(): def pause_total_tqdm():
orig = opts.data.get("multiple_tqdm", True) with patch.dict(opts.data, {"multiple_tqdm": False}, clear=False):
try:
opts.data["multiple_tqdm"] = False
yield yield
finally:
opts.data["multiple_tqdm"] = orig
@contextmanager @contextmanager