diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 21b54ef86..206e44d96 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -591,7 +591,8 @@ class LogXML: if report.when == "call": reporter.append_failure(report) self.open_reports.append(report) - reporter.write_captured_output(report) + if not self.log_passing_tests: + reporter.write_captured_output(report) else: reporter.append_error(report) elif report.skipped: