From 480f5d532a5255f8eb478469f8de4cc2e84d65d2 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 24 May 2023 14:03:48 -0400 Subject: [PATCH] Avoid pytest-cov, disable xdist in RHEL builds Coverage tests are unwanted in both RHEL and Fedora builds: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters pytest-xdist is unwanted in RHEL, so adjust the default accordingly. Also, use the %%pytest macro to set appropriate variables. --- python-rpmautospec.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python-rpmautospec.spec b/python-rpmautospec.spec index 24e4503..cdb67b3 100644 --- a/python-rpmautospec.spec +++ b/python-rpmautospec.spec @@ -1,5 +1,5 @@ # when bootstrapping Python, pytest-xdist is not yet available -%bcond_without xdist +%bcond xdist %{undefined rhel} %global srcname rpmautospec @@ -24,7 +24,6 @@ BuildRequires: python%{python3_pkgversion}-babel BuildRequires: python3-koji BuildRequires: python3-pygit2 BuildRequires: python%{python3_pkgversion}-pytest -BuildRequires: python%{python3_pkgversion}-pytest-cov %if %{with xdist} BuildRequires: python%{python3_pkgversion}-pytest-xdist %endif @@ -123,8 +122,7 @@ mkdir -p %{buildroot}%{rpmmacrodir} install -m 644 rpm/macros.d/macros.rpmautospec %{buildroot}%{rpmmacrodir}/ %check -PYTHONPATH="%{buildroot}%{python3_sitelib}" \ -%{__python3} -m pytest \ +%pytest \ %if %{with xdist} --numprocesses=auto %endif