[issue40805] Can no longer patch flask.g

2020-06-08 Thread Rob Taft
Rob Taft added the comment: https://github.com/pallets/flask/issues/3637 I've worked around the issue and accept that this will not work in the future. -- status: open -> closed ___ Python tracker _

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Rob Taft
Rob Taft added the comment: I updated the test with 2 cases and the traceback is different for each when I expected them to be the same if this was purely a mock issue, the line throwing the error is the same. I can post this over with flask and see what they think. from unittest.mock impor

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: Chris, I see no evidence in the *incomplete* traceback not posted here that there is a bug in mock. Mock calls "hasattr(obj, '__func__') and apparently flask, called via werkzeug, answers 'RuntimeError'. The overt bug is that calling werkzeug.local.(type(o

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Rob Taft
Change by Rob Taft : -- versions: +Python 3.9 -Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Rob Taft
Rob Taft added the comment: I have confirmed that using unittest.mock instead of the 3rd party mock library in python 3.8.3 and 3.9-dev fails to patch flask.g. 3.7.7 works correctly. -- ___ Python tracker

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Chris Withers
Chris Withers added the comment: Rob, you're welcome to dump `mock` and use `unittest.mock`, and that might be best for now, but this will then likely come back to bite you when you end up on the version of Python, probably 3.9, where it is present ;-) -- ___

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Chris Withers
Change by Chris Withers : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue40805] Can no longer patch flask.g

2020-06-03 Thread Chris Withers
Chris Withers added the comment: Terry, mock is now a rolling backport of unittest.mock with all development taking place in cpython's repo. If issues are reported there, they need to be triaged here first, as it's most likely a bug in unittest.mock that needs fixing here. Rob, please can y

[issue40805] Can no longer patch flask.g

2020-05-30 Thread Rob Taft
Rob Taft 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 appea

[issue40805] Can no longer patch flask.g

2020-05-29 Thread Terry J. Reedy
Terry J. Reedy 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? (Th

[issue40805] Can no longer patch flask.g

2020-05-29 Thread Ruairidh MacLeod
Change by Ruairidh MacLeod : -- nosy: +rkm ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue40805] Can no longer patch flask.g

2020-05-28 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue40805] Can no longer patch flask.g

2020-05-28 Thread Rob Taft
New submission from Rob Taft : Whenever I try to patch flask.g, it appears to do nothing. This happened when I upgraded mock from 3.x to 4.x. I reported it on the mock github page https://github.com/testing-cabal/mock/issues/490 and was asked to report it here. The folllowing code run with