diff --git a/SOURCES/852ed1092b.patch b/SOURCES/852ed1092b.patch
new file mode 100644
index 0000000..26778f6
--- /dev/null
+++ b/SOURCES/852ed1092b.patch
@@ -0,0 +1,25 @@
+From 852ed1092bd80b6b9a51db24371047ec88843031 Mon Sep 17 00:00:00 2001
+From: Stefan Behnel <stefan_ml@behnel.de>
+Date: Tue, 18 May 2021 22:02:02 +0200
+Subject: [PATCH] Adapt a test to a behavioural change in libxml2 2.9.11+.
+
+---
+ src/lxml/tests/test_etree.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py
+index 9cf70604b..42613dcbe 100644
+--- a/src/lxml/tests/test_etree.py
++++ b/src/lxml/tests/test_etree.py
+@@ -3036,7 +3036,10 @@ def test_subelement_nsmap(self):
+     def test_html_prefix_nsmap(self):
+         etree = self.etree
+         el = etree.HTML('<hha:page-description>aa</hha:page-description>').find('.//page-description')
+-        self.assertEqual({'hha': None}, el.nsmap)
++        if etree.LIBXML_VERSION < (2, 9, 11):
++            self.assertEqual({'hha': None}, el.nsmap)
++        else:
++            self.assertEqual({}, el.nsmap)
+ 
+     def test_getchildren(self):
+         Element = self.etree.Element
diff --git a/SPECS/python-lxml.spec b/SPECS/python-lxml.spec
index 7828052..82e111a 100644
--- a/SPECS/python-lxml.spec
+++ b/SPECS/python-lxml.spec
@@ -2,7 +2,7 @@
 
 Name:           python-%{modname}
 Version:        4.6.3
-Release:        3%{?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
+
 * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 4.6.3-3
 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
   Related: rhbz#1991688