File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 1717"""Common utilities."""
1818
1919import datetime
20+ import logging
2021import os
2122import signal
2223import time
@@ -156,6 +157,11 @@ def wrapper(*args, **kwargs):
156157 try :
157158 return func (* args , ** kwargs )
158159 except Exception as e :
160+ logging .warning (
161+ "Run function: %s failed: %s." ,
162+ func .__name__ ,
163+ traceback .format_exc (),
164+ ) # deprecated
159165 logger .warning (
160166 "Run function: %s failed: %s." ,
161167 func .__name__ ,
Original file line number Diff line number Diff line change 11import os
22import sys
3+ import os .path as op
4+ from unittest .mock import MagicMock
35
46import pytest
57
68import context
79
10+ cur_dir = op .dirname (op .abspath (__file__ ))
11+
12+ mock_msp = MagicMock (return_value = op .sep .join ([cur_dir , "data/mock_log" ]))
13+ mock_bundle_paths = MagicMock ()
14+ mock_bundle_paths .make_splunkhome_path = mock_msp
15+
16+ sys .modules ["splunk.clilib.bundle_paths" ] = mock_bundle_paths
17+
818
919@pytest .fixture (autouse = True , scope = "session" )
1020def setup_env ():
You can’t perform that action at this time.
0 commit comments