summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorMiro Hrončok <miro@hroncok.cz>2022-10-17 14:03:14 +0200
committerMiro Hrončok <miro@hroncok.cz>2022-10-17 14:12:46 +0200
commitc4b556166f9371d0cbc24d50dab83325aac77a3e (patch)
tree3264a1d0e8b38074e19fda97f7223bbd345ed9e6 /setuptools/tests
parentf07a248e1e58a76eac5069d8c07bdf81e981587d (diff)
downloadpython-setuptools-git-c4b556166f9371d0cbc24d50dab83325aac77a3e.tar.gz
Consistently use unittest.mock in tests
- Some tests used unittest.mock from the standard library - Some tests used mock from PyPI - Some tests tried to import unittest.mock with a fallback to mock (the import never fails on Python 3.7+, older Pythons are not supported)
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_bdist_deprecations.py2
-rw-r--r--setuptools/tests/test_build_clib.py3
-rw-r--r--setuptools/tests/test_easy_install.py2
-rw-r--r--setuptools/tests/test_packageindex.py2
-rw-r--r--setuptools/tests/test_register.py5
-rw-r--r--setuptools/tests/test_upload.py5
6 files changed, 7 insertions, 12 deletions
diff --git a/setuptools/tests/test_bdist_deprecations.py b/setuptools/tests/test_bdist_deprecations.py
index 1a900c67..1b69c418 100644
--- a/setuptools/tests/test_bdist_deprecations.py
+++ b/setuptools/tests/test_bdist_deprecations.py
@@ -1,7 +1,7 @@
"""develop tests
"""
-import mock
import sys
+from unittest import mock
import pytest
diff --git a/setuptools/tests/test_build_clib.py b/setuptools/tests/test_build_clib.py
index 48bea2b4..af9e7c6d 100644
--- a/setuptools/tests/test_build_clib.py
+++ b/setuptools/tests/test_build_clib.py
@@ -1,6 +1,7 @@
+from unittest import mock
+
import pytest
-import mock
from distutils.errors import DistutilsSetupError
from setuptools.command.build_clib import build_clib
from setuptools.dist import Distribution
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index d102e586..bca86066 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -12,7 +12,6 @@ import itertools
import distutils.errors
import io
import zipfile
-import mock
import time
import re
import subprocess
@@ -20,6 +19,7 @@ import pathlib
import warnings
from collections import namedtuple
from pathlib import Path
+from unittest import mock
import pytest
from jaraco import path
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 8e9435ef..73324aa2 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -5,8 +5,8 @@ import platform
import urllib.request
import urllib.error
import http.client
+from unittest import mock
-import mock
import pytest
import setuptools.package_index
diff --git a/setuptools/tests/test_register.py b/setuptools/tests/test_register.py
index 98605806..ed85e9bb 100644
--- a/setuptools/tests/test_register.py
+++ b/setuptools/tests/test_register.py
@@ -2,10 +2,7 @@ from setuptools.command.register import register
from setuptools.dist import Distribution
from setuptools.errors import RemovedCommandError
-try:
- from unittest import mock
-except ImportError:
- import mock
+from unittest import mock
import pytest
diff --git a/setuptools/tests/test_upload.py b/setuptools/tests/test_upload.py
index 7586cb26..4ed59bc2 100644
--- a/setuptools/tests/test_upload.py
+++ b/setuptools/tests/test_upload.py
@@ -2,10 +2,7 @@ from setuptools.command.upload import upload
from setuptools.dist import Distribution
from setuptools.errors import RemovedCommandError
-try:
- from unittest import mock
-except ImportError:
- import mock
+from unittest import mock
import pytest