Also call the superclass's tearDown() method when overriding it

Otherwise, a few unit tests start spuriously failing in certain
environments:

======================================================================
FAIL: test_validate_connection_keep_alive (vmware_nsxlib.tests.unit.v3.test_cluster.RequestsHTTPProviderTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jpichon/devel/vmware-nsxlib/vmware_nsxlib/tests/unit/v3/test_cluster.py", line 181, in test_validate_connection_keep_alive
    mock_cluster, mock_ep, mock_conn)
AssertionError: ResourceNotFound not raised by <MagicMock name='validate_connection' id='139925131978768'>

======================================================================
FAIL: test_validate_connection_method_v1 (vmware_nsxlib.tests.unit.v3.test_cluster.RequestsHTTPProviderTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jpichon/devel/vmware-nsxlib/vmware_nsxlib/tests/unit/v3/test_cluster.py", line 210, in test_validate_connection_method_v1
    mock_cluster, mock_ep, mock_conn)
AssertionError: ResourceNotFound not raised by <MagicMock name='validate_connection' id='139925131978768'>

======================================================================
FAIL: test_validate_connection_method_v2 (vmware_nsxlib.tests.unit.v3.test_cluster.RequestsHTTPProviderTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jpichon/devel/vmware-nsxlib/vmware_nsxlib/tests/unit/v3/test_cluster.py", line 223, in test_validate_connection_method_v2
    mock_cluster, mock_ep, mock_conn)
AssertionError: ResourceNotFound not raised by <MagicMock name='validate_connection' id='139925131978768'>

----------------------------------------------------------------------

Change-Id: Id5e5f8b86f7e451ea890aa124d02000589a7159a
This commit is contained in:
Julie Pichon 2020-01-08 14:52:37 +00:00 committed by Adit Sarfaty
parent 633ac40725
commit ec249d9af4
1 changed files with 1 additions and 0 deletions

View File

@ -1693,6 +1693,7 @@ class TestNsxSearch(nsxlib_testcase.NsxClientTestCase):
def tearDown(self):
self.mock.stop()
super(TestNsxSearch, self).tearDown()
@staticmethod
def get_nsxlib_version():