[test] use unittest.mock instead of mock library
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 26 Mar 2019 16:22:31 +0100
changeset 12568 fc45f22c8100
parent 12567 26744ad37953
child 12569 c197f9382e53
[test] use unittest.mock instead of mock library Now that we use Python 3 only, this is possible.
cubicweb/devtools/test/unittest_i18n.py
cubicweb/pyramid/test/test_config.py
cubicweb/server/test/unittest_serverctl.py
cubicweb/test/unittest_cwconfig.py
cubicweb/test/unittest_cwctl.py
requirements/test-misc.txt
requirements/test-server.txt
--- a/cubicweb/devtools/test/unittest_i18n.py	Fri Apr 05 17:58:19 2019 +0200
+++ b/cubicweb/devtools/test/unittest_i18n.py	Tue Mar 26 16:22:31 2019 +0100
@@ -25,8 +25,7 @@
 import sys
 from subprocess import PIPE, Popen, STDOUT
 from unittest import TestCase, main
-
-from mock import patch
+from unittest.mock import patch
 
 from cubicweb.devtools import devctl
 from cubicweb.devtools.testlib import BaseTestCase
--- a/cubicweb/pyramid/test/test_config.py	Fri Apr 05 17:58:19 2019 +0200
+++ b/cubicweb/pyramid/test/test_config.py	Tue Mar 26 16:22:31 2019 +0100
@@ -21,8 +21,7 @@
 from os import path
 from tempfile import TemporaryDirectory
 from unittest import TestCase
-
-from mock import patch
+from unittest.mock import patch
 
 
 from cubicweb.pyramid import config
--- a/cubicweb/server/test/unittest_serverctl.py	Fri Apr 05 17:58:19 2019 +0200
+++ b/cubicweb/server/test/unittest_serverctl.py	Tue Mar 26 16:22:31 2019 +0100
@@ -1,7 +1,6 @@
 import os.path as osp
 import shutil
-
-from mock import patch
+from unittest.mock import patch
 
 from cubicweb import ExecutionError
 from cubicweb.devtools import testlib, ApptestConfiguration
--- a/cubicweb/test/unittest_cwconfig.py	Fri Apr 05 17:58:19 2019 +0200
+++ b/cubicweb/test/unittest_cwconfig.py	Tue Mar 26 16:22:31 2019 +0100
@@ -26,8 +26,7 @@
 from pkg_resources import EntryPoint, Distribution
 from tempfile import TemporaryDirectory
 import unittest
-
-from mock import patch
+from unittest.mock import patch
 
 from logilab.common.modutils import cleanup_sys_modules
 
--- a/cubicweb/test/unittest_cwctl.py	Fri Apr 05 17:58:19 2019 +0200
+++ b/cubicweb/test/unittest_cwctl.py	Tue Mar 26 16:22:31 2019 +0100
@@ -20,8 +20,7 @@
 from os.path import join
 from io import StringIO
 import unittest
-
-from mock import patch
+from unittest.mock import patch
 
 from cubicweb.cwctl import ListCommand
 from cubicweb.devtools.testlib import CubicWebTC
--- a/requirements/test-misc.txt	Fri Apr 05 17:58:19 2019 +0200
+++ b/requirements/test-misc.txt	Tue Mar 26 16:22:31 2019 +0100
@@ -6,7 +6,6 @@
 
 ## cubicweb/test
 Pygments
-mock
 #fyzz XXX pip install fails
 
 ## cubicweb/devtools/test
--- a/requirements/test-server.txt	Fri Apr 05 17:58:19 2019 +0200
+++ b/requirements/test-server.txt	Tue Mar 26 16:22:31 2019 +0100
@@ -1,3 +1,2 @@
-mock
 psycopg2-binary
 ldap3 < 2