chmp / ipytest

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

warning with pytest >= 6.0 #49

Closed yuuuxt closed 3 years ago

yuuuxt commented 3 years ago

The following warning appears with corresponding link also, but I don't know how to suppress it. Could you give some advice or fix it?

vso[task.logissue type=warning;]The 'junit_family' default value will change to 'xunit2' in pytest 6.0. See:

https://docs.pytest.org/en/stable/deprecations.html#junit-family-default-value-change-to-xunit2 for more information.

chmp commented 3 years ago

Hi @yuuuxt .

It seems upgrading to pytest>=6.1 solves this issues. They updated the default value. With pytest==6.1.2, I don't get warning, irrepspective of whether I specify the --junitxml option or not.

yuuuxt commented 3 years ago

Hi @chmp ,

I'm also using pytest==6.1.2. I will try to reproduce it on other PCs to provide more information.

chmp commented 3 years ago

Hm strange. For reference, I tried with

# cell 1
import ipytest
ipytest.autoconfig(addopts=["-vv"])

# cell 2
%%run_pytest[clean]

def test_example():
    assert True

Edit: I just tested it also with assert False. It also doesn't give a warning.

yuuuxt commented 3 years ago

Finally: it was because I installed pyjanitor, which has pytest-azurepipelines as a dependency. pytest-azurepipelines generates xml report automatically, and after uninstalling it the warning disappears. (I suppose this redundant dependency issue would be fixed in this PR)

But now I have another pyreadline\py3k_compat.py warning. pyreadline comes with anaconda distribution and I cannot uninstall it with pip, saying It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Could you have a look to see how we can suppress this warning?

........\Users\xxx\anaconda3\lib\site-packages\pyreadline\py3k_compat.py:8 C:\Users\xxx\anaconda3\lib\site-packages\pyreadline\py3k_compat.py:8: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working return isinstance(x, collections.Callable)

chmp commented 3 years ago

I think this is warning coming from pyreadline itself. I fear there is nothing I can do about it. Maybe updating pyreadline to its most recent version, helps.

In any case, since these warnings are not ipytest related (you will also see them, when executing pytest itself), I will close this issue.

yuuuxt commented 3 years ago

I think so. right now I have to bear the warning until pyreadline is updated (fix is on the way). Thanks for helping!