Skip to content

DeprecationWarning with pytest 7.2 #561

Closed
@FranzForstmayr

Description

@FranzForstmayr

Summary

Using pytest 7.2 with current pytest-cov produces a DeprecationWarning

Expected vs actual result.

Test fails with:

pytest.PytestDeprecationWarning: The hookimpl CovPlugin.pytest_configure_node uses old-style configuration options (marks or attributes).

when treating warnings as errors

Versions

Tox output

py37 installed: alabaster==0.7.12,attrs==22.1.0,Babel==2.10.3,backcall==0.2.0,beautifulsoup4==4.11.1,bleach==5.0.1,certifi==2022.9.24,charset-normalizer==2.1.1,coverage==6.5.0,cycler==0.11.0,debugpy==1.6.3,decorator==5.1.1,defusedxml==0.7.1,docutils==0.17.1,entrypoints==0.4,et-xmlfile==1.1.0,exceptiongroup==1.0.0rc9,fastjsonschema==2.16.2,flake8==5.0.4,fonttools==4.38.0,idna==3.4,imagesize==1.4.1,importlib-metadata==4.2.0,importlib-resources==5.10.0,iniconfig==1.1.1,ipykernel==6.16.2,ipython==7.34.0,ipywidgets==8.0.2,jedi==0.18.1,Jinja2==3.1.2,jsonschema==4.16.0,jupyter_client==7.4.4,jupyter_core==4.11.2,jupyterlab-pygments==0.2.2,jupyterlab-widgets==3.0.3,kiwisolver==1.4.4,MarkupSafe==2.1.1,matplotlib==3.5.3,matplotlib-inline==0.1.6,mccabe==0.7.0,mistune==2.0.4,nbclient==0.7.0,nbconvert==7.2.2,nbformat==5.7.0,nbsphinx==0.8.9,nbval==0.9.6,nest-asyncio==1.5.6,networkx==2.6.3,numpy==1.21.6,openpyxl==3.0.10,packaging==21.3,pandas==1.3.5,pandocfilters==1.5.0,parso==0.8.3,pexpect==4.8.0,pickleshare==0.7.5,Pillow==9.2.0,pkgutil_resolve_name==1.3.10,pluggy==1.0.0,prompt-toolkit==3.0.31,psutil==5.9.3,ptyprocess==0.7.0,pycodestyle==2.9.1,pyflakes==2.5.0,Pygments==2.13.0,pyparsing==3.0.9,pyrsistent==0.18.1,pytest==7.2.0,pytest-cov==3.0.0,python-dateutil==2.8.2,python-ivi==0.14.9,pytz==2022.5,PyVISA==1.12.0,pyzmq==24.0.1,requests==2.28.1,-e git+ssh://[email protected]/FranzForstmayr/scikit-rf.git@f28c323ce8441b490e173ecca20772616aa90b39#egg=scikit_rf,scipy==1.7.3,six==1.16.0,snowballstemmer==2.2.0,soupsieve==2.3.2.post1,Sphinx==4.3.2,sphinx-rtd-theme==1.0.0,sphinxcontrib-applehelp==1.0.2,sphinxcontrib-devhelp==1.0.2,sphinxcontrib-htmlhelp==2.0.0,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.3,sphinxcontrib-serializinghtml==1.1.5,tinycss2==1.2.1,tomli==2.0.1,tornado==6.2,traitlets==5.5.0,typing_extensions==4.4.0,urllib3==1.26.12,wcwidth==0.2.5,webencodings==0.5.1,widgetsnbextension==4.0.3,zipp==3.10.0

Config

[tool.pytest.ini_options]
testpaths = [
    "skrf",
    "doc/source/examples",
    "doc/source/tutorials"
]
addopts = "--cov=skrf --ignore-glob='*.ipynb_checkpoints'"
norecursedirs = [
    "skrf/vi",
    "skrf/src",
    "doc/source/examples/instrumentcontrol"
]
filterwarnings = [
    "error",
    "ignore::pytest.PytestRemovedIn8Warning"
]

This line fixes the error, when added to filterwarnings

"ignore:.*hookimpl.*old-style configuration options.*:pytest.PytestDeprecationWarning"

Code

Not required

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions