From 67c939ce364f8cfe042a0965f9ff29c1cb34108e Mon Sep 17 00:00:00 2001 From: Julie Pichon Date: Wed, 8 Jan 2020 14:52:37 +0000 Subject: [PATCH] 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 ====================================================================== 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 ====================================================================== 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 ---------------------------------------------------------------------- Change-Id: Id5e5f8b86f7e451ea890aa124d02000589a7159a --- vmware_nsxlib/tests/unit/v3/test_resources.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vmware_nsxlib/tests/unit/v3/test_resources.py b/vmware_nsxlib/tests/unit/v3/test_resources.py index e25ec88f..f6311e0d 100644 --- a/vmware_nsxlib/tests/unit/v3/test_resources.py +++ b/vmware_nsxlib/tests/unit/v3/test_resources.py @@ -1759,6 +1759,7 @@ class TestNsxSearch(nsxlib_testcase.NsxClientTestCase): def tearDown(self): self.mock.stop() + super(TestNsxSearch, self).tearDown() @staticmethod def get_nsxlib_version():