From e7faf05d16943c31d4d6d38fdf78ac105c4f2674878789ec83a5928bbbfd797c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 3 Sep 2018 18:18:30 +0000 Subject: [PATCH] Accepting request 632889 from home:comurphy:branches:devel:languages:python - Fix threading tests patch for 42.3 * Add 0001-Make-test-more-resilient-against-changes-in-latest-l.patch * Remove python-lxml-assert.patch OBS-URL: https://build.opensuse.org/request/show/632889 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lxml?expand=0&rev=111 --- ...esilient-against-changes-in-latest-l.patch | 39 +++++++++++++++++++ python-lxml-assert.patch | 13 ------- python-lxml.changes | 7 ++++ python-lxml.spec | 2 +- 4 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 0001-Make-test-more-resilient-against-changes-in-latest-l.patch delete mode 100644 python-lxml-assert.patch diff --git a/0001-Make-test-more-resilient-against-changes-in-latest-l.patch b/0001-Make-test-more-resilient-against-changes-in-latest-l.patch new file mode 100644 index 0000000..8f734bf --- /dev/null +++ b/0001-Make-test-more-resilient-against-changes-in-latest-l.patch @@ -0,0 +1,39 @@ +From acef361ca80ff9afd828d91c98ea91c92f9d09af Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Sat, 4 Aug 2018 12:56:14 +0200 +Subject: [PATCH] Make test more resilient against changes in latest libxslt + releases. + +--- + src/lxml/tests/test_threading.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/lxml/tests/test_threading.py b/src/lxml/tests/test_threading.py +index 8948c3ec..5ede3f80 100644 +--- a/src/lxml/tests/test_threading.py ++++ b/src/lxml/tests/test_threading.py +@@ -130,7 +130,7 @@ class ThreadingTestCase(HelperTestCase): + + + ''' + '\n'.join('' % i for i in range(200)) + ''' +- ++ + ''') + self.assertRaises(etree.XSLTParseError, + etree.XSLT, style) +@@ -153,9 +153,10 @@ class ThreadingTestCase(HelperTestCase): + self.assertTrue(len(log)) + if last_log is not None: + self.assertEqual(len(last_log), len(log)) +- self.assertEqual(4, len(log)) ++ self.assertTrue(len(log) >= 2, len(log)) + for error in log: +- self.assertTrue(':ERROR:XSLT:' in str(error)) ++ self.assertTrue(':ERROR:XSLT:' in str(error), str(error)) ++ self.assertTrue(any('UnExpectedElement' in str(error) for error in log), log) + last_log = log + + def test_thread_xslt_apply_error_log(self): +-- +2.18.0 + diff --git a/python-lxml-assert.patch b/python-lxml-assert.patch deleted file mode 100644 index 2b750df..0000000 --- a/python-lxml-assert.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: lxml-4.2.0/src/lxml/tests/test_threading.py -=================================================================== ---- lxml-4.2.0.orig/src/lxml/tests/test_threading.py -+++ lxml-4.2.0/src/lxml/tests/test_threading.py -@@ -153,7 +153,7 @@ class ThreadingTestCase(HelperTestCase): - self.assertTrue(len(log)) - if last_log is not None: - self.assertEqual(len(last_log), len(log)) -- self.assertEqual(4, len(log)) -+ self.assertEqual(2, len(log)) - for error in log: - self.assertTrue(':ERROR:XSLT:' in str(error)) - last_log = log diff --git a/python-lxml.changes b/python-lxml.changes index 24ae730..3ca0ab1 100644 --- a/python-lxml.changes +++ b/python-lxml.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 3 14:34:43 UTC 2018 - comurphy@suse.com + +- Fix threading tests patch for 42.3 + * Add 0001-Make-test-more-resilient-against-changes-in-latest-l.patch + * Remove python-lxml-assert.patch + ------------------------------------------------------------------- Tue Aug 7 15:34:31 UTC 2018 - toddrme2178@gmail.com diff --git a/python-lxml.spec b/python-lxml.spec index 61cac5a..2cd1108 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -26,7 +26,7 @@ Group: Development/Languages/Python Url: http://lxml.de/ Source: https://files.pythonhosted.org/packages/source/l/lxml/lxml-%{version}.tar.gz Source1: http://lxml.de/lxmldoc-%{version}.pdf -Patch0: python-lxml-assert.patch +Patch0: 0001-Make-test-more-resilient-against-changes-in-latest-l.patch BuildRequires: %{python_module Cython >= 0.26.1} BuildRequires: %{python_module cssselect >= 0.9.1} BuildRequires: %{python_module devel}