Replace usage of mock with unittest.mock (#1054)

Since Python 3, the mock dependency is no more required as
it is already part of the unittest module.
This commit is contained in:
Mickaël Schoentgen 2021-04-30 15:08:27 +02:00 committed by GitHub
parent 611bcdaab1
commit 1274d869f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 7 additions and 9 deletions

View File

@ -1,4 +1,3 @@
mock
pytest
pytest-cov
pytest-httpbin>=0.0.6

View File

@ -34,7 +34,6 @@ class PyTest(TestCommand):
tests_require = [
'pytest-httpbin',
'pytest',
'mock',
]

View File

@ -1,5 +1,5 @@
"""HTTP authentication-related tests."""
import mock
from unittest import mock
import pytest
from httpie.plugins.builtin import HTTPBasicAuth

View File

@ -1,4 +1,4 @@
from mock import mock
from unittest import mock
from httpie.cli.constants import SEPARATOR_CREDENTIALS
from httpie.plugins import AuthPlugin

View File

@ -1,10 +1,10 @@
import os
import tempfile
import time
from unittest import mock
from urllib.request import urlopen
import pytest
import mock
from requests.structures import CaseInsensitiveDict
from httpie.downloads import (

View File

@ -1,4 +1,4 @@
import mock
from unittest import mock
from pytest import raises
from requests import Request
from requests.exceptions import ConnectionError

View File

@ -1,4 +1,4 @@
import mock
from unittest import mock
from httpie.status import ExitStatus
from utils import MockEnvironment, http, HTTP_OK

View File

@ -1,7 +1,7 @@
import argparse
from pathlib import Path
from unittest import mock
import mock
import json
import os
import tempfile

View File

@ -3,7 +3,7 @@ import json
import os
import shutil
from datetime import datetime
from mock import mock
from unittest import mock
from tempfile import gettempdir
import pytest