grantmcconnaughey · GitHub

I am getting an ImportError any time I run tests where I use mock. I'm using mock 1.3.0.

The error is ImportError: cannot import name wraps. It doesn't seem that installing mock requires six in setup.py when it probably should. And if it requires a specific version of six (one that has a function called wraps) then it should specify that as well.

Looks like I'm not the only one with this issue: http://stackoverflow.com/questions/31417964/importerror-cannot-import-name-wraps

Traceback:

ImportError: Failed to import test module: my_app.tests.test_forms
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 254, in _find_tests
    module = self._get_module_from_name(name)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name
    __import__(name)
  File "/Users/grant/my_app/tests/test_forms.py", line 2, in <module>
    from mock import patch, MagicMock
  File "/Users/grant/.virtualenvs/sidekick/lib/python2.7/site-packages/mock/__init__.py", line 2, in <module>
    import mock.mock as _mock
  File "/Users/grant/.virtualenvs/sidekick/lib/python2.7/site-packages/mock/mock.py", line 68, in <module>
    from six import wraps
ImportError: cannot import name wraps

Read the original on github.com ↗