This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Rob Taft
Recipients Rob Taft, rkm, terry.reedy, xtreak
Date 2020-05-30.10:42:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAOEd_8NjSzcMnrS0_QXeHecdTZ-+nAGEHeE0nSSd4L0G3Tmrkg@mail.gmail.com>
In-reply-to <1590807716.58.0.753554131312.issue40805@roundup.psfhosted.org>
Content
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 <report@bugs.python.org>
wrote:

>
> Terry J. Reedy <tjreedy@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 <report@bugs.python.org>
> <https://bugs.python.org/issue40805>
> _______________________________________
>
History
Date User Action Args
2020-05-30 10:42:18Rob Taftsetrecipients: + Rob Taft, terry.reedy, xtreak, rkm
2020-05-30 10:42:18Rob Taftlinkissue40805 messages
2020-05-30 10:42:18Rob Taftcreate