Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently use unittest.mock in tests #3638

Merged
merged 1 commit into from Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3638.misc.rst
@@ -0,0 +1 @@
Drop a test dependency on the ``mock`` package, always use :external+python:py:mod:`unittest.mock` -- by :user:`hroncok`
2 changes: 1 addition & 1 deletion pkg_resources/tests/test_markers.py
@@ -1,4 +1,4 @@
import mock
from unittest import mock

from pkg_resources import evaluate_marker

Expand Down
5 changes: 1 addition & 4 deletions pkg_resources/tests/test_pkg_resources.py
Expand Up @@ -9,10 +9,7 @@
import distutils.dist
import distutils.command.install_egg_info

try:
from unittest import mock
except ImportError:
import mock
from unittest import mock

from pkg_resources import (
DistInfoDistribution, Distribution, EggInfoDistribution,
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Expand Up @@ -59,7 +59,6 @@ testing =
pytest-perf

# local
mock
flake8-2020
virtualenv>=13.0.0
wheel
Expand Down
2 changes: 1 addition & 1 deletion setuptools/tests/test_bdist_deprecations.py
@@ -1,7 +1,7 @@
"""develop tests
"""
import mock
import sys
from unittest import mock

import pytest

Expand Down
3 changes: 2 additions & 1 deletion 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
Expand Down
2 changes: 1 addition & 1 deletion setuptools/tests/test_easy_install.py
Expand Up @@ -12,14 +12,14 @@
import distutils.errors
import io
import zipfile
import mock
import time
import re
import subprocess
import pathlib
import warnings
from collections import namedtuple
from pathlib import Path
from unittest import mock

import pytest
from jaraco import path
Expand Down
2 changes: 1 addition & 1 deletion setuptools/tests/test_packageindex.py
Expand Up @@ -5,8 +5,8 @@
import urllib.request
import urllib.error
import http.client
from unittest import mock

import mock
import pytest

import setuptools.package_index
Expand Down
5 changes: 1 addition & 4 deletions setuptools/tests/test_register.py
Expand Up @@ -2,10 +2,7 @@
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

Expand Down
5 changes: 1 addition & 4 deletions setuptools/tests/test_upload.py
Expand Up @@ -2,10 +2,7 @@
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

Expand Down