-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add unittest.mock
backport
#98
Conversation
It looks like the hard dependence on the if six.PY3:
from unittest import mock
else:
import mock I wonder if it also makes sense to make the dependency optional: if six.PY3:
from unittest import mock
mock_available = True
else:
try:
import mock
mock_available = True
except ImportError:
mock_available = False Thoughts? |
Updated accordingly though I figured that using Python3 doesn't necessarily imply that |
@ruaridhw: correct, but PyUtilib explicitly doesn't support 3.0-3.3, so we can be lazy. |
setup.py
Outdated
@@ -26,7 +26,8 @@ def read(*rnames): | |||
break | |||
return line + README.read() | |||
|
|||
requires=[ 'nose', 'six' ] | |||
|
|||
requires = ['nose', 'six', 'mock==3.0.5'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the change to the required dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
- To allow usage of `unittest.mock` in packages that import pyutilib.th as unittest
Fixes:
Summary/Motivation:
unittest.mock
in packages that import pyutilib.th as unittestChanges proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: