aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch')
-rw-r--r--community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch b/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch
new file mode 100644
index 0000000000..06f7fd2ee3
--- /dev/null
+++ b/community/py3-beautifulsoup4/fix-tests-with-syntax-error.patch
@@ -0,0 +1,54 @@
+Upstream: yes
+Reason: soupsieve changed the exception they raised, so tests need to be
+updated to reflect that.
+diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
+index e69afdf..e387e8f 100644
+--- a/bs4/tests/test_tree.py
++++ b/bs4/tests/test_tree.py
+@@ -35,6 +35,8 @@ from bs4.testing import (
+ skipIf,
+ )
+
++from soupsieve.util import SelectorSyntaxError
++
+ XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None)
+ LXML_PRESENT = (builder_registry.lookup("lxml") is not None)
+
+@@ -1949,7 +1951,7 @@ class TestSoupSelector(TreeTest):
+ self.assertEqual(len(self.soup.select('del')), 0)
+
+ def test_invalid_tag(self):
+- self.assertRaises(SyntaxError, self.soup.select, 'tag%t')
++ self.assertRaises(SelectorSyntaxError, self.soup.select, 'tag%t')
+
+ def test_select_dashed_tag_ids(self):
+ self.assertSelects('custom-dashed-tag', ['dash1', 'dash2'])
+@@ -2140,7 +2142,7 @@ class TestSoupSelector(TreeTest):
+ NotImplementedError, self.soup.select, "a:no-such-pseudoclass")
+
+ self.assertRaises(
+- SyntaxError, self.soup.select, "a:nth-of-type(a)")
++ SelectorSyntaxError, self.soup.select, "a:nth-of-type(a)")
+
+ def test_nth_of_type(self):
+ # Try to select first paragraph
+@@ -2196,7 +2198,7 @@ class TestSoupSelector(TreeTest):
+ self.assertEqual([], self.soup.select('#inner ~ h2'))
+
+ def test_dangling_combinator(self):
+- self.assertRaises(SyntaxError, self.soup.select, 'h1 >')
++ self.assertRaises(SelectorSyntaxError, self.soup.select, 'h1 >')
+
+ def test_sibling_combinator_wont_select_same_tag_twice(self):
+ self.assertSelects('p[lang] ~ p', ['lang-en-gb', 'lang-en-us', 'lang-fr'])
+@@ -2227,8 +2229,8 @@ class TestSoupSelector(TreeTest):
+ self.assertSelects('div x,y, z', ['xid', 'yid', 'zida', 'zidb', 'zidab', 'zidac'])
+
+ def test_invalid_multiple_select(self):
+- self.assertRaises(SyntaxError, self.soup.select, ',x, y')
+- self.assertRaises(SyntaxError, self.soup.select, 'x,,y')
++ self.assertRaises(SelectorSyntaxError, self.soup.select, ',x, y')
++ self.assertRaises(SelectorSyntaxError, self.soup.select, 'x,,y')
+
+ def test_multiple_select_attrs(self):
+ self.assertSelects('p[lang=en], p[lang=en-gb]', ['lang-en', 'lang-en-gb'])