make_mocked_request: subscriptable default app#3174
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3174 +/- ##
==========================================
+ Coverage 98.07% 98.07% +<.01%
==========================================
Files 43 43
Lines 7853 7860 +7
Branches 1354 1354
==========================================
+ Hits 7702 7709 +7
Misses 59 59
Partials 92 92
Continue to review full report at Codecov.
|
|
The PR doesn't crash, it's true. fails. What do you think? |
|
Well, it'd be useful for some of the tests I have, where something is accessed from the app, but whatever gets accessed doesn't get used in a meaningful way for the logic. To make it more useful I could implement def set_dict(app, key, value):
app.__app_dict[key] = value
def get_dict(app, key):
return app.__app_dict[key]
app = MagicMock()
app.__app_dict = {}
app.__getitem__ = get_dict
app.__setitem__ = set_dict |
|
yes, it is more robust |
|
@asvetlov I've updated the code. |
asvetlov
left a comment
There was a problem hiding this comment.
Please add ca change note into CHANGES folder
|
@asvetlov Added. |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
What do these changes do?
App in the default request created with make_mocked_request won't crash when accessed with
[].Are there changes in behavior for the user?
Nope.
Related issue number
#3134