Skip to content

Commit 72fa750

Browse files
author
宋文武
committed
rp_logging: Remove '_patched' when 'patching_logger_class' finished.
1 parent 3f66f5c commit 72fa750

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pytest_reportportal/rp_logging.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,7 @@ def makeRecord(self, name, level, fn, lno, msg, args, exc_info,
149149
yield
150150

151151
finally:
152-
logger_class._log = original_log
153-
logger_class.makeRecord = original_makeRecord
152+
if hasattr(logger_class, '_patched'):
153+
logger_class._log = original_log
154+
logger_class.makeRecord = original_makeRecord
155+
del logger_class._patched

0 commit comments

Comments
 (0)