From 9885f9cf3d3f5507ea2041ee7007bba150d657a9 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Tue, 5 Aug 2025 13:27:42 +0200 Subject: [PATCH] Update tests/test_utils_run_later.py --- tests/test_utils_run_later.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_utils_run_later.py b/tests/test_utils_run_later.py index 93cabc7af..83047ab15 100644 --- a/tests/test_utils_run_later.py +++ b/tests/test_utils_run_later.py @@ -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