17301: Add more logging handler teardown
[arvados.git] / sdk / cwl / tests / test_pathmapper.py
index b78e89012ad62c5f952476da0553b2d26dac5fd3..cbd5ba1bc1a7b4c7052f40af80cb0ee874a2703b 100644 (file)
@@ -32,6 +32,13 @@ class TestPathmap(unittest.TestCase):
         self.api = mock.MagicMock()
         self.api._rootDesc = get_rootDesc()
 
+    def tearDown(self):
+        root_logger = logging.getLogger('')
+
+        # Remove existing RuntimeStatusLoggingHandlers if they exist
+        handlers = [h for h in root_logger.handlers if not isinstance(h, arvados_cwl.executor.RuntimeStatusLoggingHandler)]
+        root_logger.handlers = handlers
+
     def test_keepref(self):
         """Test direct keep references."""