Skip to content

Commit 03f8f25

Browse files
author
Dmitriy Gumeniuk
authored
Merge pull request #144 from iyzsong/master
rp_logging: Remove '_patched' when 'patching_logger_class' finished.
2 parents 3f66f5c + 72fa750 commit 03f8f25

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)