summaryrefslogtreecommitdiff
path: root/bs4/tests/test_htmlparser.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-06 17:29:59 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-06 17:29:59 -0500
commit69f3a88987e6775aa2223138c488f2757b988532 (patch)
tree156f13d52f510196c76dc14b88dbf0074428347b /bs4/tests/test_htmlparser.py
parentedb1dd5e7f87d65e60d7ce39b7a7f86f84c0a64a (diff)
Monkeypatch Python 3.2 versions prior to 3.2.3 to solve some major HTMLParser bugs.
Diffstat (limited to 'bs4/tests/test_htmlparser.py')
-rw-r--r--bs4/tests/test_htmlparser.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/bs4/tests/test_htmlparser.py b/bs4/tests/test_htmlparser.py
index 8aa2471..9ba7df7 100644
--- a/bs4/tests/test_htmlparser.py
+++ b/bs4/tests/test_htmlparser.py
@@ -98,15 +98,12 @@ class TestHTMLParserTreeBuilder(TestLXMLBuilder):
self.assertEqual(soup.textarea.b.string, u" tags and <&<&")
def test_literal_in_script(self):
- # The contents of a <script> tag are supposed to be treated as
- # a literal string, even if that string contains HTML. But
- # HTMLParser attempts to parse some of the HTML, causing much
- # pain.
- javascript = 'if (i < 2) { alert("<b>foo</b>"); }'
- soup = self.soup('<script>%s</script>' % javascript)
- self.assertEqual(soup.script.contents,
- ['if (i < 2) { alert("<b>foo',
- '"); }'])
+ # Some versions of HTMLParser choke on markup like this:
+ # if (i < 2) { alert("<b>foo</b>"); }
+ # Some versions of HTMLParser don't.
+ #
+ # The easiest thing is to just not run this test for HTMLParser.
+ pass
# Namespaced doctypes cause an HTMLParseError
def test_namespaced_system_doctype(self):