You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failure: RuntimeError (Working outside of request context.
This typically means that you attempted to use functionality that needed
an active HTTP request. Consult the documentation on testing for
information about how to avoid this problem.) ... ERROR
======================================================================
ERROR: Failure: RuntimeError (Working outside of request context.
This typically means that you attempted to use functionality that needed
an active HTTP request. Consult the documentation on testing for
information about how to avoid this problem.)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/.../venv/lib/python3.8/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/Users/.../venv/lib/python3.8/site-packages/nose/plugins/manager.py", line 154, in generate
for r in result:
File "/Users/.../venv/lib/python3.8/site-packages/nose/plugins/doctests.py", line 228, in loadTestsFromModule
tests = self.finder.find(module)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/doctest.py", line 939, in find
self._find(tests, obj, name, module, source_lines, globs, {})
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/doctest.py", line 998, in _find
if ((inspect.isroutine(inspect.unwrap(val))
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/inspect.py", line 520, in unwrap
while _is_wrapper(func):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/inspect.py", line 511, in _is_wrapper
return hasattr(f, '__wrapped__')
File "/Users/.../venv/lib/python3.8/site-packages/werkzeug/local.py", line 316, in __get__
obj = instance._get_current_object() # type: ignore[misc]
File "/Users/.../venv/lib/python3.8/site-packages/werkzeug/local.py", line 509, in _get_current_object
raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of request context.
This typically means that you attempted to use functionality that needed
an active HTTP request. Consult the documentation on testing for
information about how to avoid this problem.
----------------------------------------------------------------------
Ran 1 test in 0.107s
FAILED (errors=1)
TO BE: nosetests do NOT fail (0 tests run)
In procedure 1, implementing some doctests do not change the result.
Duplicate of pallets/werkzeug#2485. This is a longstanding issue with doctest/inspect and anything else that unconditionally tries to access attributes on global objects.
Congrats on the release of Flask 2.2.0馃帀
I noticed some weird behavior.
Environment:
Procedure:
example.py
nosetests
with doctestsAS IS:
nosetests
failTO BE:
nosetests
do NOT fail (0 tests run)Workaround:
pip install -U 'flask<2.2'
(installed flask 2.1.3)Flask 2.1.3 does not raise the error.
Is this a bug embedded in the upgrade to 2.2.0?
I was wondering if it would be better to write it in the nose repository,
but I think
from frask import request
is the cause, so I'll share it here.The text was updated successfully, but these errors were encountered: