2013-08-18 22:35:19 +02:00
#
2021-12-20 02:23:22 +01:00
# spec file
2013-08-18 22:35:19 +02:00
#
2022-07-18 13:31:26 +02:00
# Copyright (c) 2022 SUSE LLC
2013-08-18 22:35:19 +02:00
#
# 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.
2018-11-08 09:39:40 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2015-05-16 19:01:48 +02:00
#
2013-08-18 22:35:19 +02:00
2021-09-14 10:46:16 +02:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%define psuffix -%{flavor}
%else
%bcond_with test
%define psuffix %{nil}
%endif
2021-11-10 14:07:53 +01:00
%define skip_python2 1
2021-09-14 10:46:16 +02:00
Name : python-pytest-cov%{psuffix}
2022-11-25 13:01:49 +01:00
Version : 4.0.0
2013-08-18 22:35:19 +02:00
Release : 0
Summary : Pytest plugin for coverage reporting
2015-05-16 19:01:48 +02:00
License : MIT
2022-07-18 13:31:26 +02:00
URL : https://github.com/pytest-dev/pytest-cov
2018-11-08 09:39:40 +01:00
Source : https://files.pythonhosted.org/packages/source/p/pytest-cov/pytest-cov-%{version} .tar.gz
2022-07-18 13:31:26 +02:00
BuildRequires : %{python_module setuptools}
%if %{with test}
2021-01-27 15:17:33 +01:00
BuildRequires : %{python_module coverage >= 5.2.1}
2019-02-13 14:12:48 +01:00
BuildRequires : %{python_module fields}
BuildRequires : %{python_module process-tests}
2020-06-29 12:11:39 +02:00
BuildRequires : %{python_module pytest >= 4.6.0}
2021-01-27 15:17:33 +01:00
BuildRequires : %{python_module pytest-xdist}
2021-11-10 14:07:53 +01:00
BuildRequires : %{python_module six}
2021-09-14 10:46:16 +02:00
BuildRequires : %{python_module virtualenv}
%endif
2018-11-08 09:39:40 +01:00
BuildRequires : fdupes
2017-04-20 20:50:03 +02:00
BuildRequires : python-rpm-macros
2021-01-27 15:17:33 +01:00
Requires : python-coverage >= 5.2.1
2020-06-29 12:11:39 +02:00
Requires : python-pytest >= 4.6.0
2013-08-18 22:35:19 +02:00
BuildArch : noarch
2017-04-20 20:50:03 +02:00
%python_subpackages
2013-08-18 22:35:19 +02:00
%description
2017-04-20 20:50:03 +02:00
This plugin produces coverage reports. It supports centralised testing
and distributed testing in both load and each modes. It also supports
coverage of subprocesses.
2013-08-18 22:35:19 +02:00
2017-04-20 20:50:03 +02:00
All features offered by the coverage package should be available, either
through pytest-cov or through coverage's config file.
2013-08-18 22:35:19 +02:00
%prep
2021-02-04 17:15:01 +01:00
%autosetup -p1 -n pytest-cov-%{version}
2013-08-18 22:35:19 +02:00
%build
2017-04-20 20:50:03 +02:00
%python_build
2013-08-18 22:35:19 +02:00
%install
2021-09-14 10:46:16 +02:00
%if ! %{with test}
2017-04-20 20:50:03 +02:00
%python_install
2018-11-08 09:39:40 +01:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}/
2021-09-14 10:46:16 +02:00
%endif
2013-08-18 22:35:19 +02:00
2019-02-13 14:12:48 +01:00
%check
2021-09-14 10:46:16 +02:00
%if %{with test}
2019-02-13 14:12:48 +01:00
# test_dist_missing_data - needs internet access
# test_central_subprocess_change_cwd_with_pythonpath - needs pytest cov in venv which is not doable in OBS build
2020-06-09 10:12:29 +02:00
export PYTHONDONTWRITEBYTECODE=1
2019-02-13 14:12:48 +01:00
echo " i m p o r t s i t e ; s i t e . a d d s i t e d i r ( \" $ ( p w d ) / s r c \" ) " > tests/sitecustomize.py
2020-06-29 12:11:39 +02:00
%python_expand PYTHONPATH=%{buildroot} %{$python_sitelib}:$PWD/tests py.test-%{$python_bin_suffix} -v -k 'not (test_dist_missing_data or test_central_subprocess_change_cwd_with_pythonpath)'
2021-09-14 10:46:16 +02:00
%endif
2019-02-13 14:12:48 +01:00
2021-09-14 10:46:16 +02:00
%if ! %{with test}
2017-04-20 20:50:03 +02:00
%files %{python_files}
2018-11-08 09:39:40 +01:00
%license LICENSE
%doc AUTHORS.rst CHANGELOG.rst README.rst
2017-04-20 20:50:03 +02:00
%{python_sitelib} /pytest-cov.pth
%{python_sitelib} /pytest_cov
%{python_sitelib} /pytest_cov-%{version} -py%{python_version} .egg-info
2021-09-14 10:46:16 +02:00
%endif
2013-08-18 22:35:19 +02:00
%changelog