Hello community,

here is the log from the commit of package python-pytest-instafail for 
openSUSE:Factory checked in at 2019-02-25 17:51:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-instafail (Old)
 and      /work/SRC/openSUSE:Factory/.python-pytest-instafail.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pytest-instafail"

Mon Feb 25 17:51:30 2019 rev:3 rq:676349 version:0.4.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-pytest-instafail/python-pytest-instafail.changes
  2019-02-15 10:02:41.715620079 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-pytest-instafail.new.28833/python-pytest-instafail.changes
       2019-02-25 17:51:31.378747710 +0100
@@ -1,0 +2,6 @@
+Fri Feb 15 09:11:23 UTC 2019 - Tomáš Chvátal <tchva...@suse.com>
+
+- Add patch to fix build with pytest 4.2+:
+  * pytest42.patch
+
+-------------------------------------------------------------------

New:
----
  pytest42.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pytest-instafail.spec ++++++
--- /var/tmp/diff_new_pack.uNuCLO/_old  2019-02-25 17:51:31.834747462 +0100
+++ /var/tmp/diff_new_pack.uNuCLO/_new  2019-02-25 17:51:31.834747462 +0100
@@ -25,7 +25,7 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/jpvanhal/pytest-instafail
 Source:         
https://files.pythonhosted.org/packages/source/p/pytest-instafail/pytest-instafail-%{version}.tar.gz
-BuildRequires:  %{python_module devel}
+Patch0:         pytest42.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -43,6 +43,7 @@
 
 %prep
 %setup -q -n pytest-instafail-%{version}
+%patch0 -p1
 
 %build
 %python_build

++++++ pytest42.patch ++++++
>From eb4ff5e5cf1811ebde34e070520142647c907726 Mon Sep 17 00:00:00 2001
From: Daniel Hahler <g...@thequod.de>
Date: Thu, 14 Feb 2019 17:12:51 +0100
Subject: [PATCH] print_failure: fix compatibility with pytest 4.2

Fixes https://github.com/pytest-dev/pytest-instafail/issues/14.
---
 pytest_instafail.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pytest_instafail.py b/pytest_instafail.py
index 495f901..1a4530c 100644
--- a/pytest_instafail.py
+++ b/pytest_instafail.py
@@ -76,11 +76,13 @@ def print_failure(self, report):
                 self.write_line(line)
             else:
                 msg = self._getfailureheadline(report)
-                if not hasattr(report, 'when'):
+                # "when" was unset before pytest 4.2 for collection errors.
+                when = getattr(report, "when", "collect")
+                if when == "collect":
                     msg = "ERROR collecting " + msg
-                elif report.when == "setup":
+                elif when == "setup":
                     msg = "ERROR at setup of " + msg
-                elif report.when == "teardown":
+                elif when == "teardown":
                     msg = "ERROR at teardown of " + msg
                 self.write_sep("_", msg)
                 if not self.config.getvalue("usepdb"):

Reply via email to