diff --git a/pytest-sugar-0.9.1.tar.gz b/pytest-sugar-0.9.1.tar.gz deleted file mode 100644 index 8a69604..0000000 --- a/pytest-sugar-0.9.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ab8cc42faf121344a4e9b13f39a51257f26f410e416c52ea11078cdd00d98a2c -size 11886 diff --git a/pytest-sugar-0.9.2.tar.gz b/pytest-sugar-0.9.2.tar.gz new file mode 100644 index 0000000..6093164 --- /dev/null +++ b/pytest-sugar-0.9.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcd87a74b2bce5386d244b49ad60549bfbc4602527797fac167da147983f58ab +size 12677 diff --git a/pytest4.patch b/pytest4.patch new file mode 100644 index 0000000..89e3dcb --- /dev/null +++ b/pytest4.patch @@ -0,0 +1,31 @@ +From 681461f488260eb8c4c9db4530b9572af058477e Mon Sep 17 00:00:00 2001 +From: Daniel Hahler +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) diff --git a/python-pytest-sugar.changes b/python-pytest-sugar.changes index 7548c9a..9b30252 100644 --- a/python-pytest-sugar.changes +++ b/python-pytest-sugar.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Tue Feb 12 15:52:25 UTC 2019 - Tomáš Chvátal + +- 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 diff --git a/python-pytest-sugar.spec b/python-pytest-sugar.spec index b38233c..09d22fc 100644 --- a/python-pytest-sugar.spec +++ b/python-pytest-sugar.spec @@ -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