Pytest error "RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue"

While trying with Ubuntu 18.04, I have faced this error while running

pytest -m connection

E _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue
~/anaconda3/lib/python3.7/site-packages/pytest_flask/plugin.py:109: RemovedInPytest4Warning
=== 39 deselected, 4 error in 0.13 seconds ==================================================================================

Solution [what worked for me] >>
After doing below it worked

  • Changed flask version in requirements.txt file from 0,10,0 to 0.11.0
  • pip install -r requirements.txt
  • pytest -m connection
  • it shows which plugin version it loads and it shops showing the error. The test passes successfully for me.
    plugins: remotedata-0.3.1, openfiles-0.3.1, flask-0.11.0, doctestplus-0.2.0, arraydiff-0.3
4 Likes

On a Windows 10 machine I have pretty much the same errors for every test, so I cannot see exactly what is happening in case of error :confused:

(mflix) C:\mongodb\m220p\mflix-python>pytest -m user_management
============================= test session starts =============================
platform win32 -- Python 3.7.1, pytest-4.0.2, py-1.7.0, pluggy-0.8.0
rootdir: C:\mongodb\m220p\mflix-python, inifile:
plugins: remotedata-0.3.1, openfiles-0.3.1, flask-0.10.0, doctestplus-0.2.0, arraydiff-0.3
collected 43 items / 39 deselected

tests\test_user_management.py EEEE                                       [100%]

=================================== ERRORS ====================================
_____________________ ERROR at setup of test_registration _____________________

request = <SubRequest '_configure_application' for <Function 'test_registration'>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x0000019A59C466A0> 

Updating flask version as you comment is the solution !!!

Thank you very much!!

2 Likes

Another solution, without edit requirements.txt

pip install -r requirements.txt
pip uninstall pytest pytest-flask
pip install pytest-flask
2 Likes

@flaresun solution worked for me.

Thanks for a great help!

Can we request the training content owners to add this as part of the readme or the main content?

This is a very common issue and if this is provided as link in the content that would save a lot of time and effort of unwanted debugging with no outcomes.

Thanks!

More correct way is use actual version of flask and pytest into requirements.txt. The training content owners have to correct versions in requirements.txt.

I don’t know how i can do it.