Accepting request 674169 from devel:languages:python:pytest

- Update to 0.9.2:
  * Fix incompatibility with pytest 3.10 (thanks @Natim)
  * Double colons for verbose output (thanks @albertodonato)
  * Fix "Wrong count with items modified in pytest_collection_modifyitems" (thanks @blueyed)
  * Defer registration of xdist hook (thanks @blueyed)
- Add patch from upstream to fix build with pytest 4.2+:
  * pytest4.patch

OBS-URL: https://build.opensuse.org/request/show/674169
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-sugar?expand=0&rev=4
This commit is contained in:
Stephan Kulow
2019-02-24 16:04:37 +00:00
committed by Git OBS Bridge
parent 94820d3085
commit 7eadfc4cd9
5 changed files with 58 additions and 10 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ab8cc42faf121344a4e9b13f39a51257f26f410e416c52ea11078cdd00d98a2c
size 11886

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fcd87a74b2bce5386d244b49ad60549bfbc4602527797fac167da147983f58ab
size 12677

31
pytest4.patch Normal file
View File

@@ -0,0 +1,31 @@
From 681461f488260eb8c4c9db4530b9572af058477e Mon Sep 17 00:00:00 2001
From: Daniel Hahler <git@thequod.de>
Date: Mon, 11 Feb 2019 22:08:41 +0100
Subject: [PATCH] Fix print_failure for pytest 4.2
Fixes https://github.com/Frozenball/pytest-sugar/issues/170.
---
pytest_sugar.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/pytest_sugar.py b/pytest_sugar.py
index 6dbe70f..c479dab 100644
--- a/pytest_sugar.py
+++ b/pytest_sugar.py
@@ -616,11 +616,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_line('')
self.write_sep("―", msg)

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Feb 12 15:52:25 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 0.9.2:
* Fix incompatibility with pytest 3.10 (thanks @Natim)
* Double colons for verbose output (thanks @albertodonato)
* Fix "Wrong count with items modified in pytest_collection_modifyitems" (thanks @blueyed)
* Defer registration of xdist hook (thanks @blueyed)
- Add patch from upstream to fix build with pytest 4.2+:
* pytest4.patch
-------------------------------------------------------------------
Sun Feb 18 21:47:34 UTC 2018 - mimi.vx@gmail.com

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-sugar
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,26 +12,28 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-sugar
Version: 0.9.1
Version: 0.9.2
Release: 0
Summary: Pretty printer for pytest progress
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://pivotfinland.com/pytest-sugar/
URL: http://pivotfinland.com/pytest-sugar/
Source: https://files.pythonhosted.org/packages/source/p/pytest-sugar/pytest-sugar-%{version}.tar.gz
Patch0: pytest4.patch
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module termcolor}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-pytest
Requires: python-termcolor
BuildArch: noarch
%python_subpackages
%description
@@ -39,6 +41,7 @@ pytest-sugar is a plugin for py.test that shows failures and errors instantly an
%prep
%setup -q -n pytest-sugar-%{version}
%patch0 -p1
%build
%python_build
@@ -47,9 +50,12 @@ pytest-sugar is a plugin for py.test that shows failures and errors instantly an
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix}
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.md
%license LICENSE
%doc README.md
%{python_sitelib}/*
%changelog