File python-pytest.spec of Package python-pytest (Revision f213a27bb0b551d0feba19a4a1390029)
Currently displaying revision f213a27bb0b551d0feba19a4a1390029 , Show latest
154
1
#
2
# spec file for package python-pytest
3
#
4
# Copyright (c) 2020 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
20
%global flavor @BUILD_FLAVOR@%{nil}
21
%if "%{flavor}" == "test"
22
%define psuffix -test
23
%bcond_without test
24
%else
25
%define psuffix %{nil}
26
%bcond_with test
27
%endif
28
Name: python-pytest%{psuffix}
29
Version: 3.10.1
30
Release: 0
31
Summary: Python testing tool with autodiscovery and detailed asserts
32
License: MIT
33
Group: Development/Languages/Python
34
URL: https://github.com/pytest-dev/pytest
35
Source: https://files.pythonhosted.org/packages/source/p/pytest/pytest-%{version}.tar.gz
36
# PATCH-FIX-UPSTREAM fix_test_raises_exception_looks_iterable.patch gh#pytest-dev/pytest#4525 mcepl@suse.com
37
Patch0: fix_test_raises_exception_looks_iterable.patch
38
# PATCH-FIX-UPSTREAM taken from master
39
Patch1: new-pluggy.patch
40
# PATCH-FIX-UPSTREAM from master
41
Patch2: sphinx2.0.patch
42
# PATCH-FIX-UPSTREAM from master
43
Patch3: importlib-metadata.patch
44
# PATCH-FIX-UPSTREAM from master
45
Patch4: importlib-py38.patch
46
# PATCH-FIX-UPSTREAM from master
47
Patch5: attrs.patch
48
BuildRequires: %{python_module setuptools >= 40.0}
49
BuildRequires: %{python_module setuptools_scm}
50
BuildRequires: fdupes
51
BuildRequires: python-rpm-macros
52
Requires: python-atomicwrites >= 1.0
53
Requires: python-attrs >= 17.4.0
54
Requires: python-importlib-metadata >= 0.12
55
Requires: python-more-itertools >= 4.0.0
56
Requires: python-packaging
57
Requires: python-pluggy >= 0.12
58
Requires: python-py >= 1.5.0
59
Requires: python-setuptools
60
Requires: python-six >= 1.10.0
61
Requires(post): update-alternatives
62
Requires(postun): update-alternatives
63
BuildArch: noarch
64
Conflicts: python-pytest
65
Provides: python-pytest = %{version}-%{release}
66
%if %{with test}
67
BuildRequires: %{python_module hypothesis}
68
BuildRequires: %{python_module pytest >= %{version}}
69
BuildRequires: %{python_module setuptools_scm}
70
BuildRequires: python-funcsigs
71
BuildRequires: python-mock
72
%endif
73
%ifpython2
74
Requires: python-funcsigs
75
%endif
76
%if "%{python_flavor}" == "python2" || %{python3_version_nodots} < 36
77
Requires: python-pathlib2 >= 2.2.0
78
%endif
79
%python_subpackages
80
81
%description
82
pytest is a cross-project Python testing tool. It provides:
83
84
* auto-discovery of test modules and functions,
85
* detailed info on failing assert statements (no need to remember
86
self.assert* names),
87
* modular fixtures for managing small or parametrized long-lived test resources.
88
* multi-paradigm support: you can use py.test to run test suites based on
89
unittest (or trial), nose,
90
* single-source compatibility to Python2.4 all the way up to Python3.3,
91
PyPy-1.9 and Jython-2.5.1, and
92
* many external plugins.
93
94
%package -n python-pytest-doc
95
Summary: Documentation for %{name}
96
Group: Development/Languages/Python
97
Provides: %{python_module python-pytest-doc = %{version}}
98
99
%description -n python-pytest-doc
100
pytest is a cross-project Python testing tool. This is a documentation
101
for the package.
102
103
%prep
104
%setup -q -n pytest-%{version}
105
%autopatch -p1
106
107
%build
108
%python_build
109
110
%install
111
%if ! %{with test}
112
%python_install
113
%python_clone -a %{buildroot}%{_bindir}/py.test
114
%python_clone -a %{buildroot}%{_bindir}/pytest
115
116
if [ -x %{buildroot}%{_bindir}/py.test-%{python2_bin_suffix} ]; then
117
ln -s py.test-%{python2_bin_suffix} %{buildroot}%{_bindir}/py.test2
118
fi
119
if [ -x %{buildroot}%{_bindir}/py.test-%{python3_bin_suffix} ]; then
120
ln -s py.test-%{python3_bin_suffix} %{buildroot}%{_bindir}/py.test3
121
fi
122
123
%python_expand %fdupes %{buildroot}%{$python_sitelib}
124
%endif
125
126
#Check here because in main package creates a buildcycle
127
%check
128
%if %{with test}
129
# test_installed_plugin_rewrite - changed with new pluggy in the behaviour
130
# but override works fine, just the tests would need way more adjustments
131
# test_request_garbage https://bugs.python.org/issue23841
132
%pytest -k 'not test_installed_plugin_rewrite and not test_request_garbage'
133
%endif
134
135
%post
136
%{python_install_alternative py.test} \
137
--slave %{_bindir}/pytest pytest %{_bindir}/pytest-%{python_version}
138
139
%postun
140
%python_uninstall_alternative py.test
141
142
%if ! %{with test}
143
%files %{python_files}
144
%doc AUTHORS CHANGELOG.rst README.rst
145
%license LICENSE
146
%python_alternative %{_bindir}/py.test
147
%python_alternative %{_bindir}/pytest
148
%python2_only %{_bindir}/py.test2
149
%python3_only %{_bindir}/py.test3
150
%{python_sitelib}/*
151
%endif
152
153
%changelog
154