From bfaa314fc55efd37e79766725f59a3e12e15d693 Mon Sep 17 00:00:00 2001 From: "pavel.butuzov" Date: Mon, 29 Jun 2026 09:40:56 +0300 Subject: [PATCH] fix: TMS-38471: fix adding traces to a message during a fixture failure for pytest. --- testit-adapter-behave/setup.py | 2 +- testit-adapter-nose/setup.py | 2 +- testit-adapter-pytest/setup.py | 2 +- .../src/testit_adapter_pytest/listener.py | 13 +++++-------- testit-adapter-robotframework/setup.py | 2 +- testit-python-commons/setup.py | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/testit-adapter-behave/setup.py b/testit-adapter-behave/setup.py index fcb6164..8c1922c 100644 --- a/testit-adapter-behave/setup.py +++ b/testit-adapter-behave/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -VERSION = "4.2.9" +VERSION = "4.2.10" setup( name='testit-adapter-behave', diff --git a/testit-adapter-nose/setup.py b/testit-adapter-nose/setup.py index 6917c7a..2e00620 100644 --- a/testit-adapter-nose/setup.py +++ b/testit-adapter-nose/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -VERSION = "4.2.9" +VERSION = "4.2.10" setup( name='testit-adapter-nose', diff --git a/testit-adapter-pytest/setup.py b/testit-adapter-pytest/setup.py index 2c18b9b..c8e6c13 100644 --- a/testit-adapter-pytest/setup.py +++ b/testit-adapter-pytest/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -VERSION = "4.2.9" +VERSION = "4.2.10" setup( name='testit-adapter-pytest', diff --git a/testit-adapter-pytest/src/testit_adapter_pytest/listener.py b/testit-adapter-pytest/src/testit_adapter_pytest/listener.py index dbbe8c9..b945d11 100644 --- a/testit-adapter-pytest/src/testit_adapter_pytest/listener.py +++ b/testit-adapter-pytest/src/testit_adapter_pytest/listener.py @@ -243,26 +243,23 @@ def pytest_runtest_logreport(self, report): if report.when == 'setup': self.__executable_test.outcome = report.outcome self.__executable_test.status_type = STATUS_TYPE.get(report.outcome, None) - if report.longreprtext: - self.__executable_test.message = report.longreprtext if report.when == 'call': self.__executable_test.outcome = report.outcome self.__executable_test.status_type = STATUS_TYPE.get(report.outcome, None) + is_xfailed = hasattr(report, 'wasxfail') and not report.passed + if report.failed or report.outcome == 'rerun': self.__executable_test.outcome = 'failed' self.__executable_test.status_type = STATUS_TYPE.get('failed', None) - if report.longreprtext: - self.__executable_test.traces = report.longreprtext - - if hasattr(report, 'wasxfail') and not report.passed: + if is_xfailed: self.__executable_test.outcome = 'xfailed' self.__executable_test.status_type = STATUS_TYPE.get('xfailed', None) - if report.longreprtext: - self.__executable_test.traces = report.longreprtext + if report.failed or report.outcome == 'rerun' or is_xfailed: + self.__executable_test.traces = getattr(report, 'longreprtext', None) self.__executable_test.duration += report.duration * 1000 diff --git a/testit-adapter-robotframework/setup.py b/testit-adapter-robotframework/setup.py index 844c364..2fb4353 100644 --- a/testit-adapter-robotframework/setup.py +++ b/testit-adapter-robotframework/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -VERSION = "4.2.9" +VERSION = "4.2.10" setup( name='testit-adapter-robotframework', diff --git a/testit-python-commons/setup.py b/testit-python-commons/setup.py index 4de2d8f..1205c64 100644 --- a/testit-python-commons/setup.py +++ b/testit-python-commons/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -VERSION = "4.2.9" +VERSION = "4.2.10" setup( name='testit-python-commons',