Skip to content
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

Some tests fail with ModuleNotFoundError: No module named 'mock' #66

Closed
kapsh opened this issue Mar 16, 2018 · 1 comment
Closed

Some tests fail with ModuleNotFoundError: No module named 'mock' #66

kapsh opened this issue Mar 16, 2018 · 1 comment

Comments

@kapsh
Copy link
Contributor

kapsh commented Mar 16, 2018

Description of the issue (include full error messages):

4 fails without mock module.

How to reproduce the issue:

# create virtualenv and install declared dependencies.
python setup.py test

Your operating system and Python release-version:

Python 3.6

What you expected to happen:

What actually happened:

======================================================================
ERROR: tests.test_query_device_capacity (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_query_device_capacity
Traceback (most recent call last):
  File "/usr/lib64/python3.6/unittest/loader.py", line 428, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib64/python3.6/unittest/loader.py", line 369, in _get_module_from_name
    __import__(name)
  File "/home/kapsh/repos/bitmath/tests/test_query_device_capacity.py", line 33, in <module>
    import mock
ModuleNotFoundError: No module named 'mock'


----------------------------------------------------------------------
Ran 206 tests in 0.026s

FAILED (errors=4)
@kapsh
Copy link
Contributor Author

kapsh commented Mar 16, 2018

I see two possible ways to fix this:

  1. Create some flexible dependencies and import system so it will use unittest.mock when available and third-party mock otherwise.
  2. Just add latter to requirements.

I would choose 2nd because I'm lazy.

kapsh added a commit to kapsh/bitmath that referenced this issue Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant