Rob Taft <rrt...@gmail.com> added the comment:

The test was supposed to patch the flask component during the unit test,
the error indicates the patch did not work.  The actual error message is
not relevant to the actual issue. I don't know why I was directed to here.
When I replace it with unittest.mock, it appears to work fine, so my
solution might end up being to dump the 3rd party mock library.

On Fri, May 29, 2020 at 11:02 PM Terry J. Reedy <rep...@bugs.python.org>
wrote:

>
> 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 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