tests: add `dask`

This commit is contained in:
Casper da Costa-Luis 2021-03-05 13:17:39 +00:00
parent 28823f4288
commit 3cab8835ad
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
3 changed files with 21 additions and 0 deletions

View File

@ -25,6 +25,7 @@ dependencies:
- flake8-comprehensions
- coverage
# extras
- dask # dask
- matplotlib # gui
- numpy # pandas, keras, contrib.tenumerate
- pandas

19
tests/tests_dask.py Normal file
View File

@ -0,0 +1,19 @@
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

View File

@ -27,6 +27,7 @@ passenv=TOXENV CI GITHUB_* CODECOV_* COVERALLS_* CODACY_* HOME
deps=
{[core]deps}
cython
dask[delayed]
matplotlib
numpy
pandas