Open hameerabbasi opened 5 years ago
```bash
============================= test session starts ==============================
platform darwin -- Python 3.7.3, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: /Users/hameerabbasi/Quansight/uarray, inifile: pytest.ini
plugins: mypy-0.3.2, flake8-1.0.4, cov-2.6.1, nbval-0.9.1
collected 69 items
notebooks/01_user_facing.ipynb EEEEEE [ 8%]
notebooks/02_basic_dev_tutorial.ipynb ^C
==================================== ERRORS ====================================
___________ ERROR at setup of notebooks/01_user_facing.ipynb::Cell 0 ___________
cls =
I am getting this same error as well. I tried downgrading notebook from 5.7.8
to 5.7.0
to see if that would help, but to no avail...
@saulshanabrook Are you getting the same error with the same notebooks, or with different ones?
@vidartf Different notebooks. In https://github.com/quansight-labs/metadsl
Are either one of you able to produce a minimal working example? Its hard to debug behavior in a completely unknown repository.
I was able to reproduce this in an minimal conda environment created like this:
conda create -n tmp -c conda-forge jupyterlab
conda activate tmp
pip install pytest pytest-cov nbval
# Create notebook file `Untitled.ipynb`
pytest --cov --nbval Untitled.ipynb
Weird, I cannot reproduce. Diff from pip freeze
:
- appnope==0.1.0
+colorama==0.4.1
- mccabe==0.6.1
- mypy-extensions==0.4.1
- pexpect==4.7.0
- ptyprocess==0.6.0
- pycodestyle==2.4.0
- pyflakes==2.0.0
+wincertstore==0.2
The package diff is mostly platform-based (I assume). Speaking of platform, I see that both of you are on OSX. Are you able to reproduce this on other platforms? I'm running on Windows here.
Anyone solved this issue yet or maybe found a workaround?
Specifying a module to cover means it won't hang, but also it won't actually pick up coverage:
pytest --cov=mymod --cov-report=term --nbval tests/test_mymod.ipynb
...
tests/test_mymod::ipynb::Cell 0 PASSED
Coverage.py warning: Module mymod was never imported. (module-not-imported)
Coverage.py warning: No data was collected. (no-data-collected)
WARNING: Failed to generate report: No data to report.
PytestWarning: Failed to generate report: No data to report.
...
EDIT: this seems to be because nbval
can't handle when test_mymod.ipynb
is in a different directory from mymod
(i.e. a workaround is mv tests/test_mymod.ipynb ./
)
Note that with normal python files (*.py
) coverage is picked up fine by comparison.
Steps to reproduce:
uarray
: https://github.com/Quansight-Labs/uarray.conda/environment.yml
nbval
addopts
line inpytest.ini
pytest --cov --nbval .
Actual output
nbval stalls, then errors with a timeout error.
Expected output
nbval should test the notebooks without a timeout.
OS/environment:
macOS 10.14
conda list
``` # packages in environment at /Users/hameerabbasi/anaconda/envs/uarray: # # Name Version Build Channel alabaster 0.7.12 py37_0 appdirs 1.4.3 py37h28b3542_0 appnope 0.1.0 py37_0 asn1crypto 0.24.0 py37_0 atomicwrites 1.3.0 py37_1 attrs 19.1.0 py37_1 autopep8 1.4.3 py37_0 babel 2.6.0 py37_0 backcall 0.1.0 py37_0 blas 1.0 mkl bleach 3.1.0 py37_0 ca-certificates 2019.1.23 0 certifi 2019.3.9 py37_0 cffi 1.12.2 py37hb5b8e2f_1 chardet 3.0.4 py37_1 click 7.0 py37_0 coverage 4.5.3 py37h1de35cc_0 cryptography 2.6.1 py37ha12b0ac_0 decorator 4.4.0 py37_1 defusedxml 0.5.0 py37_1 doc8 0.8.0 py_1 conda-forge docutils 0.14 py37_0 entrypoints 0.3 py37_0 flake8 3.7.7 py37_0 gumath 0.2.0dev3 py37_243_gd686a36 xnd/label/dev idna 2.8 py37_0 imagesize 1.1.0 py37_0 intel-openmp 2019.3 199 ipykernel 5.1.0 py37h39e3cac_0 ipython 7.4.0 py37h39e3cac_0 ipython_genutils 0.2.0 py37_0 jedi 0.13.3 py37_0 jinja2 2.10 py37_0 jsonschema 3.0.1 py37_0 jupyter_client 5.2.4 py37_0 jupyter_core 4.4.0 py37_0 jupyterlab 0.35.4 py37hf63ae98_0 jupyterlab_server 0.2.0 py37_0 libcxx 4.0.1 hcfea43d_1 libcxxabi 4.0.1 hcfea43d_1 libedit 3.1.20181209 hb402a30_0 libffi 3.2.1 h475c297_4 libgfortran 3.0.1 h93005f0_2 libgumath 0.2.0dev3 py37_243_gd686a36 xnd/label/dev libndtypes 0.2.0dev3 py37_228_gcb364d0 xnd/label/dev libsodium 1.0.16 h3efe00b_0 libxnd 0.2.0dev3 py37_229_g5fdc53b xnd/label/dev markupsafe 1.1.1 py37h1de35cc_0 mccabe 0.6.1 py37_1 mistune 0.8.4 py37h1de35cc_0 mkl 2019.3 199 mkl_fft 1.0.10 py37h5e564d8_0 mkl_random 1.0.2 py37h27c97d8_0 more-itertools 6.0.0 py37_0 mypy 0.670 py_0 mypy-extensions 0.4.1 pypi_0 pypi mypy_extensions 0.4.1 py37_0 nbconvert 5.4.1 py37_3 nbformat 4.4.0 py37_0 nbval 0.9.1 py_0 conda-forge ncurses 6.1 h0a44026_1 ndtypes 0.2.0dev3 py37_228_gcb364d0 xnd/label/dev ninja 1.9.0 py37h04f5b5a_0 notebook 5.7.8 py37_0 numpy 1.16.2 py37hacdab7b_0 numpy-base 1.16.2 py37h6575580_0 openssl 1.1.1b h1de35cc_1 packaging 19.0 py37_0 pandoc 2.2.3.2 0 pandocfilters 1.4.2 py37_1 parso 0.3.4 py37_0 pbr 5.1.3 py_0 pexpect 4.6.0 py37_0 pickleshare 0.7.5 py37_0 pip 19.0.3 py37_0 pluggy 0.9.0 py37_0 prometheus_client 0.6.0 py37_0 prompt_toolkit 2.0.9 py37_0 psutil 5.4.8 py37h1de35cc_0 ptyprocess 0.6.0 py37_0 py 1.8.0 py37_0 pycodestyle 2.5.0 py37_0 pycparser 2.19 py37_0 pyflakes 2.1.1 py37_0 pygments 2.3.1 py37_0 pyopenssl 19.0.0 py37_0 pyparsing 2.3.1 py37_0 pyrsistent 0.14.11 py37h1de35cc_0 pysocks 1.6.8 py37_0 pytest 4.3.1 py37_0 pytest-cov 2.6.1 py37_0 pytest-flake8 1.0.4 py37_0 conda-forge pytest-mypy 0.3.2 pypi_0 pypi python 3.7.3 h359304d_0 python-dateutil 2.8.0 py37_0 pytorch-cpu 1.0.1 py37h0a44026_0 conda-forge pytz 2018.9 py37_0 pyzmq 18.0.0 py37h0a44026_0 readline 7.0 h1de35cc_5 requests 2.21.0 py37_0 restructuredtext_lint 1.3.0 py_0 conda-forge rope 0.12.0 py37_0 scipy 1.2.1 py37h1410ff5_0 send2trash 1.5.0 py37_0 setuptools 40.8.0 py37_0 six 1.12.0 py37_0 snowballstemmer 1.2.1 py37_0 sphinx 1.8.5 py37_0 sphinx_rtd_theme 0.4.3 py_0 sphinxcontrib 1.0 py37_1 sphinxcontrib-websupport 1.1.0 py37_1 sqlite 3.27.2 ha441bb4_0 stevedore 1.30.1 py_0 conda-forge terminado 0.8.1 py37_1 testpath 0.4.2 py37_0 tk 8.6.8 ha441bb4_0 toml 0.10.0 py37h28b3542_0 tornado 6.0.2 py37h1de35cc_0 traitlets 4.3.2 py37_0 typed-ast 1.3.1 pypi_0 pypi typing 3.6.4 py37_0 uarray 0.4+205.g2e0e01a.dirty dev_0
urllib3 1.24.1 py37_0
wcwidth 0.1.7 py37_0
webencodings 0.5.1 py37_1
wheel 0.33.1 py37_0
xnd 0.2.0dev3 py37_229_g5fdc53b xnd/label/dev
xz 5.2.4 h1de35cc_4
zeromq 4.3.1 h0a44026_3
zlib 1.2.11 h1de35cc_3
```