Terry J. Reedy <tjre...@udel.edu> added the comment:

Sorry, but I believe you were misdirected*.  mock, as opposed to unittest.mock, 
pytest, flask, and werkzeug  are 3rd party modules.  The error report seems to 
be missing part of the stacktrace at both ends.  What line is your file 
resulted in the error?  (This time we can guess == @patch. @What called 
_lookup_app_object in flask?  (I have no idea.)

However, once contextlib._GeneratorContextManager calls next(self.gen), the 
rest of the trace is outside the stdlib.  At the end, the RuntimeError is 
raised by flask, not by python, because the flask _app_ctx_stack.top does not 
exist.  If you do not understand their error message, ask flask people.

* I assume that cjw296 *glanced* at your report, saw 'RuntimeError', and too 
quickly assumed 'cpython error'.  flask could have defined, for instance, 
FlaskRuntimeError for its error reporting.

----------
nosy: +terry.reedy
resolution:  -> third party
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40805>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to