Replace external mock with built-in unittest.mock
Now that stevedore does not support Python 2 anymore, there is no need to ever use the external 'mock' package. Python 3.3+ has it integrated as 'unittest.mock', so just use that. Change-Id: I28a50cac12670bb6987b4c7794a15e15aa1fe965 Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
parent
0c10f5cf21
commit
34b9a13049
@ -6,7 +6,7 @@ python:
|
||||
- "pypy"
|
||||
install:
|
||||
- pip install flake8 --use-mirrors
|
||||
- pip install nose mock --use-mirrors
|
||||
- pip install nose --use-mirrors
|
||||
- pip install -q . --use-mirrors
|
||||
before_script:
|
||||
- flake8 stevedore setup.py
|
||||
|
@ -11,7 +11,6 @@ imagesize==0.7.1
|
||||
Jinja2==2.10
|
||||
linecache2==1.0.0
|
||||
MarkupSafe==1.0
|
||||
mock==2.0.0
|
||||
pbr==2.0.0
|
||||
Pygments==2.2.0
|
||||
python-mimeparse==1.6.0
|
||||
|
@ -12,8 +12,9 @@
|
||||
|
||||
"""Tests for failure loading callback
|
||||
"""
|
||||
from unittest import mock
|
||||
|
||||
from testtools.matchers import GreaterThan
|
||||
import mock
|
||||
|
||||
from stevedore import extension
|
||||
from stevedore import named
|
||||
|
@ -14,8 +14,7 @@
|
||||
"""
|
||||
|
||||
import operator
|
||||
|
||||
import mock
|
||||
from unittest import mock
|
||||
|
||||
from stevedore import exception
|
||||
from stevedore import extension
|
||||
|
@ -10,11 +10,11 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from stevedore import named
|
||||
from stevedore.tests import utils
|
||||
|
||||
import mock
|
||||
|
||||
|
||||
class TestNamed(utils.TestCase):
|
||||
def test_named(self):
|
||||
|
@ -12,11 +12,12 @@
|
||||
"""Tests for the sphinx extension
|
||||
"""
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from stevedore import extension
|
||||
from stevedore import sphinxext
|
||||
from stevedore.tests import utils
|
||||
|
||||
import mock
|
||||
import pkg_resources
|
||||
|
||||
|
||||
|
@ -10,7 +10,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from mock import Mock, sentinel
|
||||
from unittest.mock import Mock, sentinel
|
||||
|
||||
from stevedore import (ExtensionManager, NamedExtensionManager, HookManager,
|
||||
DriverManager, EnabledExtensionManager)
|
||||
from stevedore.dispatch import (DispatchExtensionManager,
|
||||
|
@ -2,7 +2,6 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
mock>=2.0.0 # BSD
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
stestr>=2.0.0 # Apache-2.0
|
||||
# sphinx is needed for testing the sphinxext module
|
||||
|
Loading…
Reference in New Issue
Block a user