From 3cab8835ad70ef0e7395f0b4fdd2cec1251e0996 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 5 Mar 2021 13:17:39 +0000 Subject: [PATCH] tests: add `dask` --- environment.yml | 1 + tests/tests_dask.py | 19 +++++++++++++++++++ tox.ini | 1 + 3 files changed, 21 insertions(+) create mode 100644 tests/tests_dask.py diff --git a/environment.yml b/environment.yml index a88f03f14..2132fdc10 100644 --- a/environment.yml +++ b/environment.yml @@ -25,6 +25,7 @@ dependencies: - flake8-comprehensions - coverage # extras +- dask # dask - matplotlib # gui - numpy # pandas, keras, contrib.tenumerate - pandas diff --git a/tests/tests_dask.py b/tests/tests_dask.py new file mode 100644 index 000000000..2834abd61 --- /dev/null +++ b/tests/tests_dask.py @@ -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 diff --git a/tox.ini b/tox.ini index 18f043e71..3ecdfa0ac 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,7 @@ passenv=TOXENV CI GITHUB_* CODECOV_* COVERALLS_* CODACY_* HOME deps= {[core]deps} cython + dask[delayed] matplotlib numpy pandas