Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.2.1
-
None
-
None
-
VBC Sprint 13
-
8.2 Pipeline Integration
Description
This error seems to only appear when using a Python 3.8 environment. I read about it on several places on the internet, for example here: https://www.gitmemory.com/issue/pallets/flask/3637/655372502.
vb/tests/framework/interfaces/rest/datatype_resource_test.py:53 (TestDatatypeResource.test_server_retrieve_datatype_inexistent_gid) self = <tvb.tests.framework.interfaces.rest.datatype_resource_test.TestDatatypeResource object at 0x7fcc84668460> mocker = <pytest_mock.plugin.MockerFixture object at 0x7fcc84668580> def test_server_retrieve_datatype_inexistent_gid(self, mocker): > self._mock_user(mocker) datatype_resource_test.py:55: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ base_resource_test.py:36: in _mock_user request_mock = mocker.patch.object(flask, 'g') /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/site-packages/pytest_mock/plugin.py:197: in object return self._start_patch( /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/site-packages/pytest_mock/plugin.py:161: in _start_patch mocked = p.start() # type: unittest.mock.MagicMock /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/unittest/mock.py:1529: in start result = self.__enter__() /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/unittest/mock.py:1416: in __enter__ if spec is None and _is_async_obj(original): /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/unittest/mock.py:51: in _is_async_obj if hasattr(obj, '__func__'): /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/site-packages/werkzeug/local.py:348: in __getattr__ return getattr(self._get_current_object(), name) /Users/robert.vincze/opt/anaconda3/envs/tvb-st/lib/python3.8/site-packages/werkzeug/local.py:307: in _get_current_object return self.__local() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ name = 'g' def _lookup_app_object(name): top = _app_ctx_stack.top if top is None: > raise RuntimeError(_app_ctx_err_msg) E RuntimeError: Working outside of application context. E E This typically means that you attempted to use functionality that needed E to interface with the current application object in some way. To solve E this, set up an application context with app.app_context(). See the E documentation for more information.