Update tests/test_utils_run_later.py
Run CI Tests / test (push) Successful in 2m37s

This commit is contained in:
2025-08-05 13:27:42 +02:00
parent 08147420c4
commit 9885f9cf3d
+4 -9
View File
@@ -1,6 +1,4 @@
import pytest
import io
from contextlib import redirect_stdout
import time_machine
from datetime import datetime, timedelta
@@ -114,19 +112,16 @@ def test_run_later_with_past_datetime(capsys):
assert "it is already past" in captured
assert "Triggered: TOO LATE" not in captured
def test_run_at_tqdm_multiple_updates(monkeypatch):
output = io.StringIO()
def test_run_at_tqdm_multiple_updates(monkeypatch, capsys):
def fexample():
print("Function done!")
when = datetime.now() + timedelta(seconds=0.2)
with redirect_stdout(output):
run_at(when, fexample)
captured = output.getvalue()
run_at(when, fexample)
captured = capsys.readouterr().out
assert "0%| |" in captured
assert "50%|█████ |" in captured