mirror of
https://github.com/certbot/certbot.git
synced 2026-06-07 15:52:08 -04:00
use six instead of custom refresh function
This commit is contained in:
parent
28de5a92b2
commit
702ed89007
1 changed files with 3 additions and 9 deletions
|
|
@ -4,13 +4,7 @@ import unittest
|
|||
import sys
|
||||
|
||||
import mock
|
||||
|
||||
try:
|
||||
# Python 3.5+
|
||||
from importlib import reload as refresh # pylint: disable=no-name-in-module
|
||||
except ImportError:
|
||||
# Python 2-3.4
|
||||
from imp import reload as refresh
|
||||
from six.moves import reload_module # pylint: disable=import-error
|
||||
|
||||
|
||||
class PathSurgeryTest(unittest.TestCase):
|
||||
|
|
@ -50,14 +44,14 @@ class AlreadyListeningTestNoPsutil(unittest.TestCase):
|
|||
sys.modules['psutil'] = None
|
||||
# Reload hackery to ensure getting non-psutil version
|
||||
# loaded to memory
|
||||
refresh(certbot.plugins.util)
|
||||
reload_module(certbot.plugins.util)
|
||||
|
||||
def tearDown(self):
|
||||
# Need to reload the module to ensure
|
||||
# getting back to normal
|
||||
import certbot.plugins.util
|
||||
sys.modules["psutil"] = self.psutil
|
||||
refresh(certbot.plugins.util)
|
||||
reload_module(certbot.plugins.util)
|
||||
|
||||
@mock.patch("certbot.plugins.util.zope.component.getUtility")
|
||||
def test_ports_available(self, mock_getutil):
|
||||
|
|
|
|||
Loading…
Reference in a new issue