zonca/pytest-ipynb

Display issues (ShimWarnings) with ipython 4.x

michaelaye opened this issue · 7 comments

But otherwise, still works great! :)

$ py.test -v
/Users/klay6683/miniconda3/lib/python3.4/site-packages/IPython/nbformat.py:13: ShimWarning: The `IPython.nbformat` package has been deprecated. You should import from nbformat instead.
  "You should import from nbformat instead.", ShimWarning)
/Users/klay6683/miniconda3/lib/python3.4/site-packages/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version

  """)
/Users/klay6683/miniconda3/lib/python3.4/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)
====================================== test session starts =======================================
platform darwin -- Python 3.4.3, pytest-2.8.1, py-1.4.30, pluggy-0.3.1 -- /Users/klay6683/miniconda3/bin/python
cachedir: ../.cache
rootdir: /Users/klay6683/Dropbox/src/spicer, inifile:
plugins: ipynb-1.0.2
collected 3 items

test_spicer.ipynb::notebooks/test_spicer.ipynb PASSED
test_spicer.ipynb::notebooks/test_spicer.ipynb PASSED
test_spicer.ipynb::notebooks/test_spicer.ipynb PASSED

==================================== 3 passed in 9.15 seconds ====================================
zonca commented

thanks @michaelaye I wonder if those come from runipy.

actually it does, see paulgb/runipy#96

it will hopefully fix itself once they realease the next runipy. If not, I'll need to investigate it further.

(or you could try installing runipy from github and check, I'm being lazy, I know)

I see, I noticed a version delta of 0.0.2 between pip and conda, so I upgraded my runipy to 0.1.5, but the error still prevails. Thanks for checking.

I attached my probs to that issue.

Actually, there's another thing not working as advertised: The test names are not being read-out from the cells, I have tried the # test_name and """test_name""" formats so far, no luck. Is that related to this, or its own bug?

@zonca, actually, I have to disagree that this is still coming from runipy. See my response to @michaelaye ( paulgb/runipy#96 (comment) ). Also, that change was included in that last release ( paulgb/runipy@f4fc9af ), which is on PyPI ( https://pypi.python.org/pypi/runipy/0.1.5 ).

As far as fixing it goes, this issue comes up when using iPython 4.x in a way that one would in iPython 3.x or earlier. The imports would need to be changed like so. ( https://github.com/paulgb/runipy/blob/master/runipy/notebook_runner.py#L32 ) ( https://github.com/paulgb/runipy/blob/master/runipy/main.py#L30 ) If you need more help fixing it, I'd be more than happy to point you in the right direction.

zonca commented

@michaelaye thanks for the pointers, I think I fixed in #9

can you open other issue about labels? it was working before, broken with ipython 4

Done with #10.