Actually run the tests during build

Fixes https://bugzilla.redhat.com/2026941
This commit is contained in:
Miro Hrončok 2021-11-26 16:22:16 +01:00
commit b51ac78331
2 changed files with 38 additions and 2 deletions

View file

@ -2,7 +2,7 @@
Name: python-%{modname}
Version: 4.6.3
Release: 4%{?dist}
Release: 5%{?dist}
Summary: XML processing library combining libxml2/libxslt with the ElementTree API
# The lxml project is licensed under BSD
@ -13,6 +13,9 @@ License: BSD and MIT and zlib
URL: https://github.com/lxml/lxml
Source0: %{pypi_source %{modname}}
# Adapt a test to a behavioural change in libxml2 2.9.11+
Patch1: %{url}/commit/852ed1092b.patch
BuildRequires: gcc
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
@ -52,7 +55,11 @@ env WITH_CYTHON=true %py3_build
%py3_install
%check
%{__python3} setup.py test
# The tests assume inplace build, so we copy the built library to source-dir.
# If not done that, Python can either import the tests or the extension modules, but not both.
cp -a build/lib.%{python3_platform}-%{python3_version}/* src/
# The options are: verbose, unit, functional
%{python3} test.py -vuf
%files -n python3-%{modname}
%license LICENSES.txt doc/licenses/BSD.txt doc/licenses/elementtree.txt
@ -61,6 +68,10 @@ env WITH_CYTHON=true %py3_build
%{python3_sitearch}/%{modname}-*.egg-info/
%changelog
* Fri Nov 26 2021 Miro Hrončok <mhroncok@redhat.com> - 4.6.3-5
- Run the tests during build
- Resolves: rhbz#2026941
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.6.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild