Repository: okken/pytest-check (language: python)

Issue:
INTERNALERROR after upgrading package to 2.2.3 or 2.2.4 version
After I upgraded `pytest-check` from 2.2.2 version to 2.2.3 I started getting my test suite crashed (see attachment).
[INTERNALERROR.txt](https://github.com/okken/pytest-check/files/13961737/INTERNALERROR.txt)
The same for version 2.2.4.
Error is permanent and happens after particular test.
When I downgraded the package back to 2.2.2 the error was gone.

INTERNALERROR after upgrading package to 2.2.3 or 2.2.4 version
After I upgraded `pytest-check` from 2.2.2 version to 2.2.3 I started getting my test suite crashed (see attachment).
[INTERNALERROR.txt](https://github.com/okken/pytest-check/files/13961737/INTERNALERROR.txt)
The same for version 2.2.4.
Error is permanent and happens after particular test.
When I downgraded the package back to 2.2.2 the error was gone.



Discussion / hints:
Looks like it's possibly an interaction between the plugin and pytest-xdist and maybe Python 3.7.
I don't normally test against pytest-xdist.
i've got a small example written that reproduces the problem. I'll see what I can do
working on a fix
Looks like it's possibly an interaction between the plugin and pytest-xdist and maybe Python 3.7.
I don't normally test against pytest-xdist.
i've got a small example written that reproduces the problem. I'll see what I can do
working on a fix

Fix patch:
diff --git a/changelog.md b/changelog.md
index d9b8bca..c6aa9d2 100644
--- a/changelog.md
+++ b/changelog.md
@@ -20,6 +20,13 @@ All notable changes to this project  be documented in this file.
 
 -->
 
+## [2.2.5] - 2024-Jan-17
+
+- fix [155](https://github.com/okken/pytest-check/issues/155)
+  - Summaries from 2.2.3 are cool, but don't work with xdist
+  - Turn off summaries while xdist is running
+  - I hope I'm not seeing a pattern here
+
 ## [2.2.4] - 2024-Jan-8
 
 - fix [153](https://github.com/okken/pytest-check/issues/153)
diff --git a/pyproject.toml b/pyproject.toml
index f16c55d..e1ccf04 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ authors = [{name = "Brian Okken"}]
 readme = "README.md"
 license = {file = "LICENSE.txt"}
 description="A pytest plugin that allows multiple failures per test."
-version = "2.2.4"
+version = "2.2.5"
 requires-python = ">=3.7"
 classifiers = [
     "License :: OSI Approved :: MIT License",


Test patch:
diff --git a/src/pytest_check/plugin.py b/src/pytest_check/plugin.py
index 67b36f4..659a446 100644
--- a/src/pytest_check/plugin.py
+++ b/src/pytest_check/plugin.py
@@ -1,4 +1,5 @@
 import sys
+import os
 
 import pytest
 from _pytest._code.code import ExceptionInfo
@@ -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 ===========