Cant run pytest -m connection , deprecation warning

This is the error I got:

>       app = request.getfuncargvalue('app')
E       _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

mflix-venv/lib/python3.6/site-packages/pytest_flask/plugin.py:109: RemovedInPytest4Warning

I think pytest 4.x is to new for this tests. Any suggestions?

Hi,

You could try downgrading to pytest 3.1.0 (add pytest==3.10.1 to requirements.txt) , then reinstall pytest with pip.
Or, you can add pytest.ini file with
[pytest] filterwarnings = ignore::pytest.RemovedInPytest4Warning

Both options worked for me.

Cheers

1 Like

Thanks that worked for me :slight_smile:

For the sake of the course authors, I want to add my comments here as well.

I downgraded pytest in my virtual environment to 3.10.0 by adding it to the requirements.txt.

Trying to ignore the warning did not work for me. Additionally, updating pytest-flask to the latest version worked also, though, I have opted to go with the downgrading option just in case.

OS: Arch Linux
Python Version: 3.7.2
Pytest Version: 4.1.0

downgrading pytest worked for me. adding pytest.ini did not. perhaps I put it in the wrong place.

pip3 install pytest-flask worked for me

I personally upgraded pytest-flask to 0.14.0