Run tests during build

- use %pytest, which is shorter and sets more things
 - don't run an empty %check when --without tests
This commit is contained in:
Miro Hrončok 2022-11-10 21:16:05 +01:00
parent 60ff26a353
commit 8a85c2c1fa

View File

@ -1,9 +1,9 @@
# Allow build without test # Allow build without test
%bcond_with tests %bcond_without tests
Name: pytz Name: pytz
Version: 2022.6 Version: 2022.6
Release: 1%{?dist} Release: 2%{?dist}
Summary: World Timezone Definitions for Python Summary: World Timezone Definitions for Python
License: MIT License: MIT
@ -54,9 +54,9 @@ Requires: tzdata
rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo rm -r %{buildroot}%{python3_sitelib}/pytz/zoneinfo
%check
%if %{with tests} %if %{with tests}
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v %check
%pytest -v
%endif %endif
@ -68,6 +68,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} -m pytest -v
%changelog %changelog
* Thu Nov 10 2022 Miro Hrončok <mhroncok@redhat.com> - 2022.6-2
- Run tests during build
* Tue Nov 01 2022 Gwyn Ciesla <gwync@protonmail.com> - 2022.6-1 * Tue Nov 01 2022 Gwyn Ciesla <gwync@protonmail.com> - 2022.6-1
- 2022.6 - 2022.6