Python 如何修复此属性错误:';子请求';对象没有属性';getfuncargvalue';?
我正在Mongo大学学习MongoDB for Python开发者课程,但在mac电脑上运行pytest-m connection时遇到了这个问题: 测试/test_db_connection.py EEEE[100%] =====================================================================错误=========================================================== _____________________________________________设置test_atlas_设置时出错_____________________________________________ 请求=> monkeypatch= E AttributeError:“子请求”对象没有属性“getfuncargvalue” /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/pytest\u flask/plugin.py:109:AttributeError ____________________________________________设置测试\u基本\u影片时出错_____________________________________________ 请求=> monkeypatch= E AttributeError:“子请求”对象没有属性“getfuncargvalue” /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/pytest\u flask/plugin.py:109:AttributeError _________________________________________按电影id设置测试搜索时出错__________________________________________ 请求=> monkeypatch= E AttributeError:“子请求”对象没有属性“getfuncargvalue” /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/pytest\u flask/plugin.py:109:AttributeError _________________________________________设置测试\简单\文本\搜索时出错__________________________________________ 请求=> monkeypatch= E AttributeError:“子请求”对象没有属性“getfuncargvalue”Python 如何修复此属性错误:';子请求';对象没有属性';getfuncargvalue';?,python,python-3.x,mongodb,Python,Python 3.x,Mongodb,我正在Mongo大学学习MongoDB for Python开发者课程,但在mac电脑上运行pytest-m connection时遇到了这个问题: 测试/test_db_connection.py EEEE[100%] =====================================================================错误=========================================================== ________
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/pytest\u flask/plugin.py:109:AttributeError尝试更新项目的依赖项,pytest、pymongo和flask的默认依赖项非常旧。更新后,我成功地通过了测试。同样的事情也发生在我身上。我在requirements.txt中添加了attrs==19.1.0,它成功了 从错误消息中,您正在使用Python3.7
您可能正在使用已弃用的
getfuncargvalue
而不是所述的getfixturevalue
。更新所有软件包并解决兼容性问题,但它无法正常工作:)
@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
"""Use `pytest.mark.options` decorator to pass options to your application
factory::
@pytest.mark.options(debug=False)
def test_something(app):
assert not app.debug, 'the application works not in debug mode!'
"""
if 'app' not in request.fixturenames:
return
app = request.getfuncargvalue('app')
@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
"""Use `pytest.mark.options` decorator to pass options to your application
factory::
@pytest.mark.options(debug=False)
def test_something(app):
assert not app.debug, 'the application works not in debug mode!'
"""
if 'app' not in request.fixturenames:
return
app = request.getfuncargvalue('app')
@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
"""Use `pytest.mark.options` decorator to pass options to your application
factory::
@pytest.mark.options(debug=False)
def test_something(app):
assert not app.debug, 'the application works not in debug mode!'
"""
if 'app' not in request.fixturenames:
return
app = request.getfuncargvalue('app')
@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
"""Use `pytest.mark.options` decorator to pass options to your application
factory::
@pytest.mark.options(debug=False)
def test_something(app):
assert not app.debug, 'the application works not in debug mode!'
"""
if 'app' not in request.fixturenames:
return
app = request.getfuncargvalue('app')