chmp / ipytest

Pytest in IPython notebooks.
MIT License
314 stars 17 forks source link

Deprecation warning with pytest 5.4.1 #32

Closed joschkazj closed 4 years ago

joschkazj commented 4 years ago

Hi,

First of all a big thank you for implementing this package! This was the last missing bit for working productively in a notebook (together with nbdev).

For my installation of pytest 5.4.1 I get a deprecation warning during my first test with the example

%%run_pytest[clean] -qq

def test_example():
    assert [1, 2, 3] == [1, 2, 3]

full warning:

.                                                                                      [100%]
===================================== warnings summary ======================================
<conda-env-path>\lib\site-packages\ipytest\_pytest_support.py:110
  <conda-env-path>\lib\site-packages\ipytest\_pytest_support.py:110: PytestDeprecationWarning: direct construction of Module has been deprecated, please use Module.from_parent
    return Module(path=path, parent=parent, module=self.module)

-- Docs: https://docs.pytest.org/en/latest/warnings.html

This is nothing urgent or blocking but I wanted to let you know about this for future updates to this project.

chmp commented 4 years ago

Hi @joschkazj,

Thanks for the positive feedback and the issue. It should be fixed with the newly released version. Would you mind giving it a spin and test whether it works for you? You can install it with pip install ipytest==0.8.0 . There are no backwards incompatible changes. Hence, the upgrade should not create any issues for you.

Also really need to checkout nbdev :). Hearing lot's of good things about it.

Thanks

joschkazj commented 4 years ago

Hi, Thanks for the quick response! I'm sorry for not checking the installed version of ipytest - this issue occurs for v0.5.0 which is the latest conda package released on conda-forge. Indeed, installing v0.8.0 via pip fixes the issue. :-)

chmp commented 4 years ago

Perfect. Thanks for the quick feedback.