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
This commit is contained in:
Markéta Machová 2021-05-18 09:33:28 +00:00 committed by Git OBS Bridge
parent 2934840861
commit 49b1f1f2f0
2 changed files with 12 additions and 1 deletions

View File

@ -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 <dmueller@suse.com> Tue Mar 23 20:19:43 UTC 2021 - Dirk Müller <dmueller@suse.com>

View File

@ -27,7 +27,11 @@ Group: Development/Languages/Python
URL: https://pypi.python.org/pypi/defusedxml URL: https://pypi.python.org/pypi/defusedxml
Source: https://files.pythonhosted.org/packages/source/d/defusedxml/defusedxml-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/d/defusedxml/defusedxml-%{version}.tar.gz
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module xml} BuildRequires: %{python_module xml}
# /SECTION
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-xml Requires: python-xml
@ -55,7 +59,9 @@ pitfalls.
%if %{with tests} %if %{with tests}
%check %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 %endif
%files %{python_files} %files %{python_files}