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:
Will Greenberg
2022-09-28 16:17:03 -07:00
committed by GitHub
co-authored by Alex Zorin
parent c9eba6ccd3
commit 26d479d6e3
82 changed files with 79 additions and 388 deletions
+1 -5
View File
@@ -1,13 +1,9 @@
"""Tests for AugeasParserNode classes"""
from typing import List
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
import os
import util
from unittest import mock
from certbot import errors
+1 -5
View File
@@ -2,11 +2,7 @@
"""Test for certbot_apache._internal.configurator AutoHSTS functionality"""
import re
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot_apache._internal import constants
+1 -5
View File
@@ -1,10 +1,6 @@
"""Test for certbot_apache._internal.configurator for Centos overrides"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot.compat import filesystem
@@ -1,11 +1,7 @@
"""Test for certbot_apache._internal.configurator implementations of reverter"""
import shutil
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
import util
+1 -5
View File
@@ -5,11 +5,7 @@ import shutil
import socket
import tempfile
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from acme import challenges
from certbot import achallenges
+1 -5
View File
@@ -1,11 +1,7 @@
"""Test for certbot_apache._internal.configurator for Debian overrides"""
import shutil
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot.compat import os
+1 -5
View File
@@ -1,10 +1,6 @@
"""Test certbot_apache._internal.display_ops."""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot.display import util as display_util
+1 -5
View File
@@ -1,10 +1,6 @@
"""Tests for DualParserNode implementation"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot_apache._internal import assertions
from certbot_apache._internal import augeasparser
+1 -5
View File
@@ -1,10 +1,6 @@
"""Test for certbot_apache._internal.entrypoint for override class resolution"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot_apache._internal import configurator
from certbot_apache._internal import entrypoint
+1 -5
View File
@@ -1,10 +1,6 @@
"""Test for certbot_apache._internal.configurator for Fedora 29+ overrides"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot.compat import filesystem
+1 -5
View File
@@ -1,10 +1,6 @@
"""Test for certbot_apache._internal.configurator for Gentoo overrides"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot.compat import filesystem
+1 -5
View File
@@ -2,11 +2,7 @@
import unittest
import errno
from typing import List
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from acme import challenges
from certbot import achallenges
+1 -5
View File
@@ -1,11 +1,7 @@
"""Tests for certbot_apache._internal.parser."""
import shutil
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot import errors
from certbot.compat import os
@@ -1,10 +1,6 @@
"""Tests for ApacheConfigurator for AugeasParserNode classes"""
import unittest
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
import util
+1 -5
View File
@@ -4,11 +4,7 @@ import unittest
import augeas
import josepy as jose
try:
import mock
except ImportError: # pragma: no cover
from unittest import mock # type: ignore
from unittest import mock
from certbot.compat import os
from certbot.plugins import common