mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Remove external mock dependency (#9331)
* Remove external mock dependency This also removes the "external-mock" test environment * remove superfluous ignores * remove mock warning ignore from pytest.ini * drop deps on mock in oldest, drop dep on types-mock Co-authored-by: Alex Zorin <alex@zorin.id.au>
This commit is contained in:
co-authored by
Alex Zorin
parent
c9eba6ccd3
commit
26d479d6e3
@@ -2,12 +2,9 @@
|
||||
import functools
|
||||
import shutil
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import josepy as jose
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
|
||||
from acme import challenges
|
||||
from certbot import achallenges
|
||||
|
||||
@@ -3,6 +3,7 @@ import functools
|
||||
import string
|
||||
from typing import List
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import pkg_resources
|
||||
|
||||
@@ -12,11 +13,6 @@ from certbot._internal.plugins import null
|
||||
from certbot._internal.plugins import standalone
|
||||
from certbot._internal.plugins import webroot
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
|
||||
|
||||
EP_SA = pkg_resources.EntryPoint(
|
||||
"sa", "certbot._internal.plugins.standalone",
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
"""Tests for certbot.plugins.dns_common_lexicon."""
|
||||
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
from unittest import mock
|
||||
|
||||
from certbot.plugins import dns_common_lexicon
|
||||
from certbot.plugins import dns_test_common_lexicon
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
import collections
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
from unittest import mock
|
||||
|
||||
from certbot import errors
|
||||
from certbot import util
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
"""Tests for new style enhancements"""
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
from unittest import mock
|
||||
|
||||
from certbot._internal.plugins import null
|
||||
from certbot.plugins import enhancements
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
import sys
|
||||
import textwrap
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
from unittest import mock
|
||||
|
||||
from acme import challenges
|
||||
from certbot import errors
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
"""Tests for certbot._internal.plugins.null."""
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
from unittest import mock
|
||||
|
||||
|
||||
class InstallerTest(unittest.TestCase):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import sys
|
||||
from typing import List
|
||||
import unittest
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
@@ -11,11 +11,6 @@ from certbot._internal.plugins.disco import PluginsRegistry
|
||||
from certbot.display import util as display_util
|
||||
from certbot.tests import util as test_util
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
|
||||
|
||||
class ConveniencePickPluginTest(unittest.TestCase):
|
||||
"""Tests for certbot._internal.plugins.selection.pick_*."""
|
||||
|
||||
@@ -5,6 +5,7 @@ from typing import Dict
|
||||
from typing import Set
|
||||
from typing import Tuple
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import josepy as jose
|
||||
import OpenSSL.crypto
|
||||
@@ -16,11 +17,6 @@ from certbot import errors
|
||||
from certbot.tests import acme_util
|
||||
from certbot.tests import util as test_util
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
|
||||
|
||||
class ServerManagerTest(unittest.TestCase):
|
||||
"""Tests for certbot._internal.plugins.standalone.ServerManager."""
|
||||
|
||||
@@ -4,17 +4,13 @@ from typing import Iterable
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from certbot import errors
|
||||
from certbot.compat import filesystem
|
||||
from certbot.compat import os
|
||||
from certbot.tests import util as test_util
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
|
||||
|
||||
|
||||
class PluginStorageTest(test_util.ConfigTestCase):
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
"""Tests for certbot.plugins.util."""
|
||||
import unittest
|
||||
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
from unittest import mock
|
||||
|
||||
from certbot.compat import os
|
||||
|
||||
|
||||
@@ -8,12 +8,9 @@ import json
|
||||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import josepy as jose
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock
|
||||
|
||||
from acme import challenges
|
||||
from certbot import achallenges
|
||||
|
||||
Reference in New Issue
Block a user