%bcond_with test

Name:           python-pytest-cov
Version:        7.1.0
Release:        1
Summary:        Pytest plugin for measuring coverage
License:        MIT
URL:            https://github.com/pytest-dev/pytest-cov
Source0:        %{url}/archive/v%{version}/pytest-cov-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pip
BuildRequires:  python3-wheel
BuildRequires:	python3-hatchling
BuildRequires:  python3-hatch-fancy-pypi-readme

%description
This plugin produces coverage reports. Compared to just using coverage run this plugin does some extras:
* Subprocess support: you can fork or run stuff in a subprocess and will get covered without any fuss.
* Xdist support: you can use all of pytest-xdist’s features and still get coverage.
* Consistent pytest behavior. If you run coverage run -m pytest you will have slightly different
  sys.path(CWD will be in it, unlike when running pytest).

All features offered by the coverage package should work, either through pytest-cov’s command line options
or through coverage’s config file.

%package -n python3-pytest-cov
Summary:        Pytest plugin for measuring coverage
BuildRequires:  python3-devel python3-setuptools python3-pytest python3-coverage >= 3.7.1
%if %{with test}
BuildRequires:  python3-process-tests python3-six python3-virtualenv
%endif
Requires:       python3-pytest python3-coverage >= 3.7.1
%{?python_provide:%python_provide python3-pytest-cov}

%description -n python3-pytest-cov
This plugin produces coverage reports. Compared to just using coverage run this plugin does some extras:
* Subprocess support: you can fork or run stuff in a subprocess and will get covered without any fuss.
* Xdist support: you can use all of pytest-xdist’s features and still get coverage.
* Consistent pytest behavior. If you run coverage run -m pytest you will have slightly different
  sys.path(CWD will be in it, unlike when running pytest).

All features offered by the coverage package should work, either through pytest-cov’s command line options
or through coverage’s config file.

%prep
%autosetup -p1 -n pytest-cov-%{version}

%build
%pyproject_build

%install
%pyproject_install

%check
%if %{with test}
PYTHONPATH=%{buildroot}%{python3_sitelib}:$PWD/tests py.test-%{python3_version} -vv || :
%endif

%files -n python3-pytest-cov
%doc AUTHORS.rst CHANGELOG.rst CONTRIBUTING.rst README.rst LICENSE
%{python3_sitelib}/*

%changelog
* Fri May 08 2026  openeuler_bot <infra@openeuler.sh> - 7.1.0-1
- update python-pytest-cov to 7.1.0 

* Wed Dec 31 2025 Yu Peng <yupeng@kylinos.cn> - 7.0.0-1
- Upgrade to 7.0.0 
  * Dropped support for subprocesses measurement.
  * Switched packaging to have metadata completely in pyproject.toml and use hatchling for building. 
  * Removed some not really necessary testing deps like six.

* Fri Jul 4 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 6.2.1-1
- Update package to version 6.2.1
  Prevent unimported warnings @ pytest-xdist workers ref
  Add a note for this warning disable
  Fix document theme option in sphinx config file

* Fri May 30 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 6.1.1-2
- Fix source name for build

* Sun Apr 20 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 6.1.1-1
- Update package with version 6.1.1
  Add note on security and add link to subprocess docs
  Reword --cov-config caveat section and hopefully clear confusions
  Support Coverage 7.5's HTML report changes
  Looks like the template was left with the old versions
  Add reproducer for weird xdist dynamic_context interaction
  Implement error/warning for the bad dynamic_context being set in config
  Move the warnings/errors in a place that doesn't import anything
  Configure Sphinx to ignore GitHub comment anchors

* Mon Aug 26 2024 dillon chen <dillon.chen@gmail.com> - 5.0.0-1
- update to 5.0.0

* Wed Jul 12 2023 luluoc <luluoc@isoftstone.com> - 4.1.0-2
- change py3 to pyproject

* Fri Jun 9 2023 chaozhangm <chaozhangm@isoftstone.com> - 4.1.0-1
- update to 4.1.0

* Tue Apr 26 2022 caodongxia <caodongxia@h-partners.com> - 3.0.0-1
- update to 3.0.0 

* Fri Sep 11 2020 wangyue <wangyue92@huawei.com> - 2.5.1-8
- Remove  python2-pytest-cov

* Wed Jan  8 2020 lingsheng <lingsheng@huawei.com> - 2.5.1-7
- Package init