This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user