update Certbot's mock usage

This commit is contained in:
Brad Warren 2021-02-01 15:02:55 -08:00
parent 31cb5cc147
commit 9da4dd685d
2 changed files with 7 additions and 8 deletions

View file

@ -6,12 +6,19 @@ import shutil
import sys
import tempfile
import unittest
import warnings
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import josepy as jose
try:
import mock
warnings.warn(
"The external mock module is being used for backwards compatibility "
"since it is available, however, future versions of Certbot's tests will "
"use unittest.mock. Be sure to update your code accordingly.",
PendingDeprecationWarning
)
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
import OpenSSL

View file

@ -72,14 +72,6 @@ elif os.name == 'nt':
# setuptools, pywin32 will not be specified as a dependency.
install_requires.append(pywin32_req)
if setuptools_known_environment_markers:
install_requires.append('mock ; python_version < "3.3"')
elif 'bdist_wheel' in sys.argv[1:]:
raise RuntimeError('Error, you are trying to build certbot wheels using an old version '
'of setuptools. Version 36.2+ of setuptools is required.')
elif sys.version_info < (3,3):
install_requires.append('mock')
dev_extras = [
'coverage',
'pytest',