File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def __set_logging_configuration():
5858 mwi_env .get_env_name_logging_level (), __get_default_log_level ()
5959 ).upper ()
6060
61- if __is_not_valid_log_level (log_level ):
61+ if __is_invalid_log_level (log_level ):
6262 default_log_level = __get_default_log_level ()
6363 logging .warning (
6464 f"Unknown log level '{ log_level } ' set. Defaulting to log level '{ default_log_level } '..."
@@ -134,14 +134,14 @@ def __get_default_log_level():
134134 return "INFO"
135135
136136
137- def __is_not_valid_log_level (log_level ):
137+ def __is_invalid_log_level (log_level ):
138138 """Helper to check if the log level is valid.
139139
140140 Returns:
141141 Boolean: Whether log level exists
142142 """
143143
144- return log_level not in logging . getLevelNamesMapping (). keys ( )
144+ return not hasattr ( logging , log_level )
145145
146146
147147def log_startup_info (title = None , matlab_url = None ):
Original file line number Diff line number Diff line change 1010@pytest .fixture
1111def reset_logger_handlers ():
1212 """Fixture to reset logger handlers after each test."""
13- yield
1413 logger = mwi_logger .get ()
1514 logger .handlers .clear ()
1615
You can’t perform that action at this time.
0 commit comments