%global srcname pytest-cov %global forgeurl https://github.com/pytest-dev/%{srcname} Name: python-%{srcname} Version: 3.0.0 %forgemeta Release: %autorelease Summary: Coverage plugin for pytest License: MIT URL: %{forgeurl} Source0: %{forgesource} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros BuildRequires: python3dist(pip) BuildRequires: python3dist(toml) BuildRequires: python3dist(wheel) BuildRequires: python3dist(fields) BuildRequires: python3dist(pytest) >= 4.6 BuildRequires: python3dist(coverage) >= 5.2.1 BuildRequires: python3dist(virtualenv) BuildRequires: python3dist(pytest-xdist) BuildRequires: python3dist(process-tests) %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-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.} %description %{common_description} %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %{common_description} %prep %forgeautosetup # 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 %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 }' <