-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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