-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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's default app should be a MagicMock #3134
Comments
Well, make sense. |
@asvetlov I'd need to know how to set up the tests, because trying to run tox on master failed miserably. Or should I base the PR on a tagged release commit? |
@butla, |
@butla https://docs.aiohttp.org/en/stable/contributing.html has some info about contributions into the project. A fork from the current master should work perfectly fine. @webknjaz sorry for the delay about tox decision. Will do it soon. |
@webknjaz As for travis.yml - that's the most complex YAML file I've ever seen, I've no idea what's going on :) But I'm guessing I should just run |
Yes, Filing CONTRIBUTING is up to you. |
@butla that basically means that CI should remain green. So you can skip local testing if you have difficulties of setting it up. P.S. In Travis's config I use lots of anchors to avoid copy-paste, which would be even harder to track. Meanwhile, I'm thinking of a solution, which would simplify this stuff and maybe make that readable :) |
I think I'm seeing the same error when I run
|
@webknjaz Well, the CI's red right now, from what I see on the main project page... |
@butla you should sync git submodules to get http-parser sources on your machine. |
Apparently, CI log is out of 4MB limit for those jobs, that's why they've been terminated by Travis. I hope that with the introduction of tox-centric flow we'll be able to split that into smaller parts.. |
Fixed by #3174 |
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. |
Long story short
App is, among other things, a container for objects with an application-wide use. The default right now is to populate the
app
in theRequest
returned bymake_mocked_request
withunittest.mock.Mock
, which doesn't support indexing, thus crashing when values in theapp
are accessed, unless MagicMock (or a dictionary) is explicitly put asapp
in the the call tomake_mocked_request
. I think the default should be to create the app as a MagicMock.I couldn't test if that would brake any tests, because running tox was just spewing missing .h file errors at me and wouldn't run anything.
Expected behaviour
Actual behaviour
Your environment
Aiohttp server: 3.3.2
OS: Kubuntu 17.10 x64
The text was updated successfully, but these errors were encountered: