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:
parent
bcf20e2466
commit
67c939ce36
|
@ -1759,6 +1759,7 @@ class TestNsxSearch(nsxlib_testcase.NsxClientTestCase):
|
|||
|
||||
def tearDown(self):
|
||||
self.mock.stop()
|
||||
super(TestNsxSearch, self).tearDown()
|
||||
|
||||
@staticmethod
|
||||
def get_nsxlib_version():
|
||||
|
|
Loading…
Reference in New Issue