Accepting request 662938 from home:mcepl:branches:devel:languages:python:pytest

- Switch the package to multibuild.
- Add fix_test_raises_exception_looks_iterable.patch from
  gh#pytest-dev/pytest#4525

OBS-URL: https://build.opensuse.org/request/show/662938
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest?expand=0&rev=23
This commit is contained in:
Tomáš Chvátal
2019-01-07 08:53:28 +00:00
committed by Git OBS Bridge
parent c1937857ff
commit 2c2fe721aa
6 changed files with 89 additions and 1481 deletions
File diff suppressed because it is too large Load Diff
+7
View File
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Jan 4 22:08:17 CET 2019 - mcepl@suse.com
- Switch the package to multibuild.
- Add fix_test_raises_exception_looks_iterable.patch from
gh#pytest-dev/pytest#4525
-------------------------------------------------------------------
Wed Nov 14 14:00:29 UTC 2018 - Ondřej Súkup <mimi.vx@gmail.com>
-64
View File
@@ -1,64 +0,0 @@
#
# spec file for package python-pytest-doc
#
# Copyright (c) 2018 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-doc
Version: 3.10.1
Release: 0
Summary: Documentation for python-pytest, a testing tool with autodiscovery
License: MIT
Group: Documentation/HTML
URL: https://github.com/pytest-dev/pytest
Source: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest = %{version}}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: python-mock
BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx
BuildRequires: python3-sphinxcontrib-trio
Provides: %{python_module pytest-doc = %{version}}
BuildArch: noarch
%ifpython2
BuildRequires: python-funcsigs
%endif
%description
This package contains the documentation to pytest, a cross-project Python
testing tool.
%prep
%setup -q -n pytest-%{version}
%build
python3 setup.py build_sphinx
rm doc/build/html/.buildinfo
%install
# Only building documentation
#Check here because in main package creates a buildcycle
%check
%{python_expand py.test-%{$python_bin_suffix}}
%files
%doc CHANGELOG.rst
%doc doc/build/html
%license LICENSE
%changelog
+53 -1
View File
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest
#
# 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
@@ -17,7 +17,17 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%else
%bcond_with test
%endif
%if %{with test}
Name: python-pytest-%{flavor}
%else
Name: python-pytest
%endif
Version: 3.10.1
Release: 0
Summary: Python testing tool with autodiscovery and detailed asserts
@@ -25,10 +35,21 @@ License: MIT
Group: Development/Languages/Python
URL: https://github.com/pytest-dev/pytest
Source: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix_test_raises_exception_looks_iterable.patch gh#pytest-dev/pytest#4525 mcepl@suse.com
Patch0: fix_test_raises_exception_looks_iterable.patch
BuildRequires: %{python_module setuptools >= 40.0}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module pytest = %{version}}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: python-funcsigs
BuildRequires: python-mock
BuildRequires: python3-Sphinx
BuildRequires: python3-sphinxcontrib-trio
%endif
Requires: python-atomicwrites >= 1.0
Requires: python-attrs >= 17.4.0
Requires: python-more-itertools >= 4.0.0
@@ -60,13 +81,28 @@ pytest is a cross-project Python testing tool. It provides:
PyPy-1.9 and Jython-2.5.1, and
* many external plugins.
%package -n python-pytest-doc
Summary: Documentation for %{name}
Group: Development/Languages/Python
Provides: %{python_module python-pytest-doc = %{version}}
%description -n python-pytest-doc
pytest is a cross-project Python testing tool. This is a documentation
for the package.
%prep
%setup -q -n pytest-%{version}
%autopatch -p1
%build
%python_build
%if %{with test}
python3 setup.py build_sphinx
rm doc/build/html/.buildinfo
%endif
%install
%if ! %{with test}
%python_install
%python_clone -a %{buildroot}%{_bindir}/py.test
%python_clone -a %{buildroot}%{_bindir}/pytest
@@ -79,6 +115,13 @@ if [ -x %{buildroot}%{_bindir}/py.test-%{python3_bin_suffix} ]; then
fi
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
#Check here because in main package creates a buildcycle
%check
%if %{with test}
%{python_expand py.test-%{$python_bin_suffix}}
%endif
%post
%{python_install_alternative py.test} \
@@ -90,10 +133,19 @@ fi
%files %{python_files}
%doc AUTHORS CHANGELOG.rst README.rst
%license LICENSE
%if ! %{with test}
%python_alternative %{_bindir}/py.test
%python_alternative %{_bindir}/pytest
%python2_only %{_bindir}/py.test2
%python3_only %{_bindir}/py.test3
%{python_sitelib}/*
%endif
%if %{with test}
%files -n python-pytest-doc
%doc CHANGELOG.rst
%doc doc/build/html
%license LICENSE
%endif
%changelog
+3
View File
@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>
@@ -0,0 +1,26 @@
From 5ecbb02ace74d0bcb49226c59060f04df9dc2b31 Mon Sep 17 00:00:00 2001
From: Daniel Hahler <git@thequod.de>
Date: Mon, 10 Dec 2018 06:26:23 +0100
Subject: [PATCH] tests: fix test_raises_exception_looks_iterable
Started to fail on py37-xdist between
https://travis-ci.org/pytest-dev/pytest/jobs/465498973 and
https://travis-ci.org/pytest-dev/pytest/jobs/465792343, but could not
find a diff in versions (from the tox header), and both commits failed
locally.
---
testing/python/raises.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/testing/python/raises.py
+++ b/testing/python/raises.py
@@ -169,7 +169,8 @@ class TestRaises(object):
pass
with pytest.raises(
- Failed, match="DID NOT RAISE <class 'raises.ClassLooksIterableException'>"
+ Failed,
+ match=r"DID NOT RAISE <class 'raises(\..*)*ClassLooksIterableException'>",
):
pytest.raises(ClassLooksIterableException, lambda: None)