Skip to content

Commit

Permalink
Fix #155, turn off summaries with xdist
Browse files Browse the repository at this point in the history
  • Loading branch information
okken committed Jan 17, 2024
1 parent 20d654f commit b31e50d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pytest_check/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import os

import pytest
from _pytest._code.code import ExceptionInfo
Expand Down Expand Up @@ -40,9 +41,11 @@ def pytest_runtest_makereport(item, call):
raise AssertionError(report.longrepr)
except AssertionError as e:
excinfo = ExceptionInfo.from_current()
if pytest.version_tuple >= (7,3,0):
if (pytest.version_tuple >= (7,3,0)
and not os.getenv('PYTEST_XDIST_WORKER')):
# Build a summary report with failure reason
# Depends on internals of pytest, which changed in 7.3
# Also, doesn't work with xdist
#
# Example: Before 7.3:
# =========== short test summary info ===========
Expand Down

0 comments on commit b31e50d

Please sign in to comment.