-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Testing fails with ModuleNotFoundError: No module named 'aiohttp' #1577
Comments
@logileifs Can you please add the stack trace to the bug description? |
|
# Install sanic with test utilities
$ pip3 install "sanic[test]" |
@logileifs But I agree with what you mentioned under expected behavior. I think @huge-success/sanic-core-devs Any concerns moving |
Is this documented anywhere? I believe I've read the documentation rather well and I don't recall seeing anywhere mentioned that sanic provides any extra packages |
@logileifs There is a reference for this under the |
I do not think we should include it in the standard install because it is an extra dependency that is not needed. However, on the flip side, I think having I also would highly push developers towards: https://github.com/yunstanford/pytest-sanic. |
I disagree with you there @ahopkins, to develop a web application you need to be able to test it, to test it you apparently need I've tried many different web frameworks and don't remember any single one of them requiring you to install some extra dependencies just for testing. I think that is a very weird and untrustworthy approach, makes it seem like testing is an afterthought |
@logileifs In this case, then, your build packages and containers become bloated with unused code and unused dependencies. I am not saying it has to be this way, but that this is the decision that was made: favor speed and making things lean. Indeed, there are plenty of ways to test Sanic applications that do not require using the |
@ahopkins fair enough |
@logileifs If you are testing your own service written using @ahopkins You are right. Now that I think about it again after reading your comments, it should be enough to document this rather than moving it to the default list of dependencies installed. Thanks for pointing me in the right direction. |
Describe the bug
After installing sanic and setting up tests like in the documentation and running them sanic fails with
ModuleNotFoundError: No module named 'aiohttp'
.It succeeds after installing 'aiohttp' manually
Code snippet
Just do a clean install of sanic and create a test as in the documentation and try running it.
Expected behavior
If 'aiohttp' is a hard dependency for testing it should be included when installing sanic
Environment (please complete the following information):
Stack trace
The text was updated successfully, but these errors were encountered: