mirror of
https://github.com/certbot/certbot.git
synced 2026-08-02 00:22:28 +02:00
Do not require mock in Python 3 in certbot-dns modules (#7900)
Part of #7886. This PR conditionally installs `mock` in `certbot-dns-*/setup.py` based on setuptools version and python version, when possible. It then updates the tests to use `unittest.mock` when `mock` isn't available. * Do not require mock in Python 3 in certbot-dns modules * update changelog * error when trying to build wheels with old setuptools * add type: ignores
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock # type: ignore
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
from certbot.compat import os
|
||||
|
||||
Reference in New Issue
Block a user