I am working with Pycharm, trying to run scrapy unit tests - and it fails to run. The errors are for missing imports, seems like all imports are failing. e.g.
Import error... "no module named mock"
what I did:
Get scrapy from github
Run pip to install all dependencies from requirements.txt
Installed TOX , made sure I can run the tests using TOX.
Configured Pycharm to run tests using py.test
I'm working on Ubuntu 14.04, Python 2.7 .
You need to additionally pip install the tests requirements:
pip install -r tests/requirements.txt # Python 2
pip install -r tests/requirements-py3.txt # Python 3
That would install the mock
package and solve the no module named mock
on Python 2 (assuming you are installing into the same environment, you are running tests from).
Note that to run the tests, you should use tox
(which would also install the missing dependencies from requirements.txt
during a test run setup phase):
tox -- tests/test_loader.py
(just done all of that and the tests are running and passing for me).
FYI, here is my PyCharm configuration for the tox runner:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With