From 49b1f1f2f0bdc8e635dc15725262020fa8fadc83e3578dbc0028891678b39460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 18 May 2021 09:33:28 +0000 Subject: [PATCH] Accepting request 893998 from home:pgajdos:python - use %pytest macro, run lxml tests OBS-URL: https://build.opensuse.org/request/show/893998 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-defusedxml?expand=0&rev=18 --- python-defusedxml.changes | 5 +++++ python-defusedxml.spec | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/python-defusedxml.changes b/python-defusedxml.changes index 4236b2f..c260d4c 100644 --- a/python-defusedxml.changes +++ b/python-defusedxml.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 18 09:25:03 UTC 2021 - pgajdos@suse.com + +- use %pytest macro, run lxml tests + ------------------------------------------------------------------- Tue Mar 23 20:19:43 UTC 2021 - Dirk Müller diff --git a/python-defusedxml.spec b/python-defusedxml.spec index 5dcf4a6..69f4176 100644 --- a/python-defusedxml.spec +++ b/python-defusedxml.spec @@ -27,7 +27,11 @@ Group: Development/Languages/Python URL: https://pypi.python.org/pypi/defusedxml Source: https://files.pythonhosted.org/packages/source/d/defusedxml/defusedxml-%{version}.tar.gz BuildRequires: %{python_module setuptools} +# SECTION test requirements +BuildRequires: %{python_module lxml} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module xml} +# /SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-xml @@ -55,7 +59,9 @@ pitfalls. %if %{with tests} %check -%python_exec setup.py test +# see test_main() in tests.py; test_html_arg: deprecation warning is not raised, perhaps capturing wrongly setup? +usable_tests=$(grep addTests tests.py | sed 's:.*makeSuite(\([a-zA-Z]*\)).*:\1:' | tr '\n' ' ' | sed -e 's: $::' -e 's: : or :g') +%pytest -s -k "($usable_tests) and not test_html_arg" %endif %files %{python_files}