Skip to content

Commit daa5fac

Browse files
authored
Merge pull request #158 from pytest-dev/aantonov/gh_156_fix_xdist_report
[GH-156] Fixed report duplication for Xdist workers
2 parents 321fda8 + 46c22b0 commit daa5fac

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

pytest_slack/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.2.0'
1+
__version__ = '2.2.4'

pytest_slack/plugin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
9191

9292
if not config.option.slack_hook:
9393
return
94+
# special check for pytest-xdist plugin, cause we do not want to send report for each worker.
95+
if hasattr(terminalreporter.config, 'workerinput'):
96+
return
9497
timeout = config.option.slack_timeout
9598
failed = len(terminalreporter.stats.get('failed', []))
9699
passed = len(terminalreporter.stats.get('passed', []))
@@ -103,7 +106,7 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
103106
slack_hook = config.option.slack_hook
104107
channel = config.option.slack_channel
105108
ssl_verify = config.option.ssl_verify
106-
109+
107110
slack_username = config.option.slack_username if config.option.slack_username else 'Regression testing results'
108111

109112
if int(exitstatus) == 0:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
test_suite='tests',
4949
tests_require=test_requirements,
5050
url='https://github.com/pytest-dev/pytest-slack',
51-
version='2.2.0',
51+
version='2.2.4',
5252
zip_safe=False,
5353
entry_points={
5454
'pytest11': [

0 commit comments

Comments
 (0)