Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pyquery for openSUSE:Factory 
checked in at 2023-02-19 18:18:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyquery (Old)
 and      /work/SRC/openSUSE:Factory/.python-pyquery.new.22824 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pyquery"

Sun Feb 19 18:18:28 2023 rev:21 rq:1066414 version:1.4.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyquery/python-pyquery.changes    
2022-08-22 11:04:54.045671115 +0200
+++ /work/SRC/openSUSE:Factory/.python-pyquery.new.22824/python-pyquery.changes 
2023-02-19 18:18:29.893304234 +0100
@@ -1,0 +2,6 @@
+Fri Feb 17 16:46:13 UTC 2023 - Matej Cepl <mc...@suse.com>
+
+- Add make_webtest_optional.patch to allow testing without
+  WebTest module.
+
+-------------------------------------------------------------------

New:
----
  make_webtest_optional.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pyquery.spec ++++++
--- /var/tmp/diff_new_pack.Osgp1C/_old  2023-02-19 18:18:30.493308047 +0100
+++ /var/tmp/diff_new_pack.Osgp1C/_new  2023-02-19 18:18:30.497308072 +0100
@@ -1,7 +1,7 @@
 #
 # spec file
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
 #
 
 
-%{?!python_module:%define python_module() python3-%{**}}
 %define skip_python2 1
 %global flavor @BUILD_FLAVOR@%{nil}
 %if "%{flavor}" == "test"
@@ -34,6 +33,9 @@
 Group:          Development/Languages/Python
 URL:            https://pypi.python.org/pypi/pyquery
 Source:         
https://files.pythonhosted.org/packages/source/p/pyquery/pyquery-%{version}.tar.gz
+# PATCH-FIX-OPENSUSE make_webtest_optional.patch mc...@suse.com
+# Make it possible to run test suite (albeit partial) without WebTest module
+Patch0:         make_webtest_optional.patch
 BuildRequires:  %{python_module cssselect > 0.7.9}
 BuildRequires:  %{python_module lxml >= 2.1}
 BuildRequires:  %{python_module setuptools}
@@ -44,9 +46,11 @@
 BuildArch:      noarch
 %if %{with test}
 BuildRequires:  %{python_module WebOb > 1.1.9}
-BuildRequires:  %{python_module WebTest}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module requests}
+%if 0%{?suse_version} > 1550
+BuildRequires:  %{python_module WebTest}
+%endif
 %endif
 %python_subpackages
 
@@ -56,7 +60,7 @@
 XML and HTML manipulation.
 
 %prep
-%setup -q -n pyquery-%{version}
+%autosetup -p1 -n pyquery-%{version}
 
 %build
 %python_build

++++++ make_webtest_optional.patch ++++++
---
 tests/test_pyquery.py |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- a/tests/test_pyquery.py
+++ b/tests/test_pyquery.py
@@ -7,9 +7,12 @@ import time
 from lxml import etree
 from pyquery.pyquery import PyQuery as pq, no_default
 from pyquery.openers import HAS_REQUEST
-from webtest import http
-from webtest.debugapp import debug_app
-from unittest import TestCase
+from unittest import TestCase, skipIf
+try:
+    from webtest import http
+    from webtest.debugapp import debug_app
+except (ImportError, ModuleNotFoundError):
+    http = None
 
 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
 
@@ -835,6 +838,7 @@ class TestXMLNamespace(TestCase):
         self.assertEqual(repr(val), repr('b'))
 
 
+@skipIf(http is None, "Cannot test without WebTest")
 class TestWebScrapping(TestCase):
 
     def setUp(self):
@@ -879,6 +883,7 @@ class TestWebScrappingEncoding(TestCase)
         self.assertEqual(d('#pt-login').text(), u'Войти')
 
 
+@skipIf(http is None, "Cannot test without WebTest")
 class TestWebScrappingTimeouts(TestCase):
 
     def setUp(self):

Reply via email to