From ea944168cc0587eb7e9ccdf6d46c49213518efbf Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Thu, 21 May 2020 12:40:19 +0530 Subject: [PATCH] Changed the import of mock to unittest.mock Signed-off-by: Shubham Mishra --- teuthology/test/test_exit.py | 2 +- teuthology/test/test_ls.py | 2 +- teuthology/test/test_misc.py | 2 +- teuthology/test/test_nuke.py | 2 +- teuthology/test/test_packaging.py | 2 +- teuthology/test/test_repo_utils.py | 2 +- teuthology/test/test_results.py | 2 +- teuthology/test/test_run.py | 2 +- teuthology/test/test_timer.py | 2 +- teuthology/test/test_vps_os_vers_parameter_checking.py | 2 +- teuthology/test/test_worker.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/teuthology/test/test_exit.py b/teuthology/test/test_exit.py index 4a685fcb4a..b688b5216e 100644 --- a/teuthology/test/test_exit.py +++ b/teuthology/test/test_exit.py @@ -2,7 +2,7 @@ import os import random import signal -from mock import patch, Mock +from unittest.mock import patch, Mock from teuthology import exit diff --git a/teuthology/test/test_ls.py b/teuthology/test/test_ls.py index 48ff1ce4d6..631dcfd46f 100644 --- a/teuthology/test/test_ls.py +++ b/teuthology/test/test_ls.py @@ -1,6 +1,6 @@ import pytest -from mock import patch, Mock +from unittest.mock import patch, Mock from teuthology import ls diff --git a/teuthology/test/test_misc.py b/teuthology/test/test_misc.py index bb4e67d90e..8756a3df08 100644 --- a/teuthology/test/test_misc.py +++ b/teuthology/test/test_misc.py @@ -1,7 +1,7 @@ import argparse from datetime import datetime -from mock import Mock, patch +from unittest.mock import Mock, patch from teuthology.orchestra import cluster from teuthology.config import config from teuthology import misc diff --git a/teuthology/test/test_nuke.py b/teuthology/test/test_nuke.py index f75aedef7b..c660e7ee19 100644 --- a/teuthology/test/test_nuke.py +++ b/teuthology/test/test_nuke.py @@ -4,7 +4,7 @@ import os import pytest import subprocess -from mock import patch, Mock, DEFAULT +from unittest.mock import patch, Mock, DEFAULT from teuthology import nuke from teuthology import misc diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index c85d06e223..fcc340d0e7 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -1,6 +1,6 @@ import pytest -from mock import patch, Mock +from unittest.mock import patch, Mock from teuthology import packaging from teuthology.exceptions import VersionNotFoundError diff --git a/teuthology/test/test_repo_utils.py b/teuthology/test/test_repo_utils.py index 445a91d9f7..2aa57a06ec 100644 --- a/teuthology/test/test_repo_utils.py +++ b/teuthology/test/test_repo_utils.py @@ -1,5 +1,5 @@ import logging -import mock +import unittest.mock as mock import os import os.path from pytest import raises, mark diff --git a/teuthology/test/test_results.py b/teuthology/test/test_results.py index 421a64d8de..f1dc58747c 100644 --- a/teuthology/test/test_results.py +++ b/teuthology/test/test_results.py @@ -3,7 +3,7 @@ from teuthology.config import config from teuthology import results from teuthology import report -from mock import patch, DEFAULT +from unittest.mock import patch, DEFAULT class TestResultsEmail(object): diff --git a/teuthology/test/test_run.py b/teuthology/test/test_run.py index 3510aa0b2d..5a7b073ad8 100644 --- a/teuthology/test/test_run.py +++ b/teuthology/test/test_run.py @@ -1,7 +1,7 @@ import pytest import docopt -from mock import patch, call, Mock +from unittest.mock import patch, call, Mock from teuthology import run from scripts import run as scripts_run diff --git a/teuthology/test/test_timer.py b/teuthology/test/test_timer.py index 5c671c17e2..312a9c8b86 100644 --- a/teuthology/test/test_timer.py +++ b/teuthology/test/test_timer.py @@ -1,6 +1,6 @@ from teuthology import timer -from mock import MagicMock, patch, mock_open +from unittest.mock import MagicMock, patch, mock_open from time import time diff --git a/teuthology/test/test_vps_os_vers_parameter_checking.py b/teuthology/test/test_vps_os_vers_parameter_checking.py index 73b6029dff..43ad5ae303 100644 --- a/teuthology/test/test_vps_os_vers_parameter_checking.py +++ b/teuthology/test/test_vps_os_vers_parameter_checking.py @@ -1,4 +1,4 @@ -from mock import patch, Mock +from unittest.mock import patch, Mock import teuthology.lock.util from teuthology import provision diff --git a/teuthology/test/test_worker.py b/teuthology/test/test_worker.py index d966d3476b..49c3dd1786 100644 --- a/teuthology/test/test_worker.py +++ b/teuthology/test/test_worker.py @@ -1,7 +1,7 @@ import beanstalkc import os -from mock import patch, Mock, MagicMock +from unittest.mock import patch, Mock, MagicMock from datetime import datetime, timedelta from teuthology import worker -- 2.39.5