Skip to content

Commit 3c64853

Browse files
authored
record.attachment overwritten by None value
I faced with an issue when attachment I send to rp_logger.info was empty in some cases. Going through the code, I noticed that wrap_makeRecord actually handles situations when "attachment" is in the "extra" parameter and then performs record.attachment = attachment (at the end of wrap_makeRecord -> makeRecord method). But when wrapper finishes, right in the next line code overwrites correct value of record.attachment with None value.
1 parent cb3e447 commit 3c64853

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pytest_reportportal/rp_logging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def _log(self, level, msg, args,
4444
record = self.makeRecord(self.name, level, fn, lno, msg, args,
4545
exc_info, func, extra, sinfo)
4646

47-
record.attachment = attachment
47+
if not record.attachment:
48+
record.attachment = attachment
4849
self.handle(record)
4950

5051

0 commit comments

Comments
 (0)