You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-pytest-cov/python-pytest-cov.spec

89 lines
2.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

%global srcname pytest-cov
%global forgeurl https://github.com/pytest-dev/%{srcname}
Name: python-%{srcname}
Version: 2.11.1
%forgemeta
Release: %autorelease
Summary: Coverage plugin for pytest
License: MIT
URL: %{forgeurl}
Source0: %{forgesource}
Patch0: 0001-fix-for-failing-tests-with-coverage-5.4.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
%global common_description %{expand:
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-xdists 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-covs command line options or through coverages config file.}
%description %{common_description}
%package -n python3-%{srcname}
Summary: %{summary}
%description -n python3-%{srcname} %{common_description}
%prep
%forgeautosetup -p1
# We cannot satisfy exact-version pins; loosen them up and work with what we have.
sed -r -i 's/==/>=/g' setup.py
# The “hunter” testing dependency (https://github.com/ionelmc/python-hunter) is
# not packaged, but it also does not seem to be used.
sed -r -i '/^[[:blank:]]*.hunter.,[[:blank:]]*$/d' setup.py
%generate_buildrequires
%pyproject_buildrequires -x testing
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files pytest_cov
%check
k="$(awk 'NR>1 {pre=" and " } { printf "%snot %s", pre, $0 }' <<EOF
test_append_coverage_subprocess
test_central_subprocess
test_cleanup_on_sigterm
test_dist_missing_data
test_dist_subprocess_collocated
test_dist_subprocess_not_collocated
test_subprocess_with_path_aliasing
EOF
)"
%pytest -k "${k}"
%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE
%doc AUTHORS.rst CHANGELOG.rst CONTRIBUTING.rst README.rst
%{python3_sitelib}/%{srcname}.pth
%changelog
%autochangelog