Merge "Remove python 3.6 mock hack"

This commit is contained in:
Zuul 2023-07-07 14:41:12 +00:00 committed by Gerrit Code Review
commit eb7eae3425

@ -26,7 +26,6 @@ import os
import subprocess
import sys
import tempfile
from unittest import mock
import warnings
import eventlet
@ -57,21 +56,6 @@ logging.register_options(CONF)
logging.setup(CONF, 'ironic')
# NOTE(rpittau) this function allows autospec for classmethods and
# staticmethods in Python 3.6, while no issue occurs in Python 3.7.4
# and later.
# For more info please see: http://bugs.python.org/issue23078
def _patch_mock_callable(obj):
if isinstance(obj, type):
return True
if getattr(obj, '__call__', None) is not None:
return True
if (isinstance(obj, (staticmethod, classmethod))
and mock._callable(obj.__func__)):
return True
return False
BASE_TEST_TIMEOUT = os.environ.get('BASE_TEST_TIMEOUT', 60)