Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #155, turn off summaries with xdist #156

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
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