From 0e5d39f4e11d2769629573ec3d7137a55a232c42b94b3579580b8b3224d32a71 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 13 Oct 2021 12:07:13 +0000 Subject: [PATCH 1/2] Accepting request 925065 from home:pgajdos:python - %check: use %pyunittest rpm macro OBS-URL: https://build.opensuse.org/request/show/925065 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.testbrowser?expand=0&rev=21 --- _multibuild | 3 +++ python-zope.testbrowser.changes | 5 +++++ python-zope.testbrowser.spec | 31 ++++++++++++++++++++++++++----- 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 _multibuild diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-zope.testbrowser.changes b/python-zope.testbrowser.changes index f61c14c..0f19af3 100644 --- a/python-zope.testbrowser.changes +++ b/python-zope.testbrowser.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 5 12:40:02 UTC 2021 - pgajdos@suse.com + +- %check: use %pyunittest rpm macro + ------------------------------------------------------------------- Tue Jan 21 10:36:36 UTC 2020 - Marketa Calabkova diff --git a/python-zope.testbrowser.spec b/python-zope.testbrowser.spec index 01d2587..d8b6177 100644 --- a/python-zope.testbrowser.spec +++ b/python-zope.testbrowser.spec @@ -1,7 +1,7 @@ # -# spec file for package python-zope.testbrowser +# spec file # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -Name: python-zope.testbrowser +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +Name: python-zope.testbrowser%{psuffix} Version: 5.5.1 Release: 0 Summary: Programmable browser for functional black-box tests @@ -42,10 +50,10 @@ Suggests: python-mock Suggests: python-zope.testing BuildArch: noarch # SECTION test requirements +%if %{with test} BuildRequires: %{python_module WSGIProxy2} BuildRequires: %{python_module WebTest >= 2.0.30} BuildRequires: %{python_module beautifulsoup4} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytz > dev} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} @@ -53,7 +61,9 @@ BuildRequires: %{python_module soupsieve >= 1.9.0} BuildRequires: %{python_module zope.cachedescriptors} BuildRequires: %{python_module zope.interface} BuildRequires: %{python_module zope.schema} +BuildRequires: %{python_module zope.testbrowser} BuildRequires: %{python_module zope.testing} +%endif # /SECTION %python_subpackages @@ -68,18 +78,29 @@ site. %patch0 -p1 %build +%if !%{with test} +sed -i 's:import mock:import unittest.mock as mock:' src/zope/testbrowser/tests/test_wsgi.py %python_build +%endif %install +%if !%{with test} %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif %check -%python_exec setup.py test +%if %{with test} +cd src +%pyunittest zope/testbrowser/tests/test_*.py +# TODO doctests +%endif %files %{python_files} +%if !%{with test} %doc CHANGES.rst README.rst %license LICENSE.rst %{python_sitelib}/* +%endif %changelog From a7ca67a034a2216f1e32f0b57ab0b427ba8ad4b1a5a4e67f6a18412c24b24d39 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 13 Oct 2021 12:10:22 +0000 Subject: [PATCH 2/2] - Make tests verbose OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zope.testbrowser?expand=0&rev=22 --- python-zope.testbrowser.changes | 5 +++++ python-zope.testbrowser.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python-zope.testbrowser.changes b/python-zope.testbrowser.changes index 0f19af3..c66d48e 100644 --- a/python-zope.testbrowser.changes +++ b/python-zope.testbrowser.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 13 12:10:13 UTC 2021 - Matej Cepl + +- Make tests verbose + ------------------------------------------------------------------- Tue Oct 5 12:40:02 UTC 2021 - pgajdos@suse.com diff --git a/python-zope.testbrowser.spec b/python-zope.testbrowser.spec index d8b6177..c46aa8e 100644 --- a/python-zope.testbrowser.spec +++ b/python-zope.testbrowser.spec @@ -92,7 +92,7 @@ sed -i 's:import mock:import unittest.mock as mock:' src/zope/testbrowser/tests/ %check %if %{with test} cd src -%pyunittest zope/testbrowser/tests/test_*.py +%pyunittest -v zope/testbrowser/tests/test_*.py # TODO doctests %endif