tqdm/tests/tests_dask.py

20 lines
452 B
Python
Raw Normal View History

2021-03-05 13:17:39 +00:00
from __future__ import division
from time import sleep
from .tests_tqdm import importorskip, mark
pytestmark = mark.slow
def test_dask(capsys):
"""Test tqdm.dask.TqdmCallback"""
ProgressBar = importorskip('tqdm.dask').TqdmCallback
dask = importorskip('dask')
schedule = [dask.delayed(sleep)(i / 10) for i in range(5)]
with ProgressBar():
dask.compute(schedule)
_, err = capsys.readouterr()
assert '5/5' in err