Remove makeMockThreadSafe()

It doesn't appear to be compatible with newer versions of python
and the mock library, and wasn't working correctly anyways.

Change-Id: I117d01bed40849587b2d0337aad56fccdf77e192
This commit is contained in:
Sean Eagan 2020-02-06 08:55:25 -06:00
parent adc8f306aa
commit 1d9d645a5e
2 changed files with 1 additions and 27 deletions

View File

@ -17,34 +17,10 @@
# under the License.
import random
import string
import threading
import uuid
import mock
import testtools
_mock_thread_safe = False
_mock_call_lock = threading.RLock()
# TODO(seaneagan): Get this working.
def makeMockThreadSafe():
'''
This attempts to make a subset of the mock library thread safe using
locking, so that the mock call records are accurate.
'''
global _mock_thread_safe
if not _mock_thread_safe:
unsafe_mock_call = mock.CallableMixin._mock_call
def safe_mock_call(*args, **kwargs):
with _mock_call_lock:
return unsafe_mock_call(*args, **kwargs)
mock.CallableMixin._mock_call = safe_mock_call
_mock_thread_safe = True
def rand_uuid_hex():
"""Generate a random UUID hex string

View File

@ -19,7 +19,7 @@ from armada import const
from armada.handlers import armada
from armada.utils.helm import TESTRUN_STATUS_SUCCESS, TESTRUN_STATUS_FAILURE
from armada.tests.unit import base
from armada.tests.test_utils import AttrDict, makeMockThreadSafe
from armada.tests.test_utils import AttrDict
from armada.utils.release import release_prefixer, get_release_status
from armada.exceptions import ManifestException
from armada.exceptions.override_exceptions import InvalidOverrideValueException
@ -27,8 +27,6 @@ from armada.exceptions.validate_exceptions import InvalidManifestException
from armada.exceptions import tiller_exceptions
from armada.exceptions.armada_exceptions import ChartDeployException
makeMockThreadSafe()
TEST_YAML = """
---
schema: armada/Manifest/v1