From 0909884d21621394c0e810c508ceb4a4743ab8b5 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 20 Feb 2012 10:01:21 -0500 Subject: Added code from 2.7's standard library so that the tests will run on Python 2.6. --- bs4/tests/test_html5lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bs4/tests/test_html5lib.py') diff --git a/bs4/tests/test_html5lib.py b/bs4/tests/test_html5lib.py index d972b2d..f1f3727 100644 --- a/bs4/tests/test_html5lib.py +++ b/bs4/tests/test_html5lib.py @@ -10,8 +10,9 @@ from test_lxml import ( TestLXMLBuilderEncodingConversion, ) import unittest +from bs4.testing import skipIf -@unittest.skipIf( +@skipIf( not HTML5LIB_PRESENT, "html5lib seems not to be present, not testing its tree builder.") class TestHTML5Builder(TestLXMLBuilder): @@ -81,7 +82,7 @@ class TestHTML5Builder(TestLXMLBuilder): # get a CData object. self.assertSoupEquals(markup, "") -@unittest.skipIf( +@skipIf( not HTML5LIB_PRESENT, "html5lib seems not to be present, not testing it on invalid markup.") class TestHTML5BuilderInvalidMarkup(TestLXMLBuilderInvalidMarkup): @@ -246,7 +247,7 @@ class TestHTML5BuilderInvalidMarkup(TestLXMLBuilderInvalidMarkup): self.assertEqual(soup.p.string, u"\N{REPLACEMENT CHARACTER}") -@unittest.skipIf( +@skipIf( not HTML5LIB_PRESENT, "html5lib seems not to be present, not testing encoding conversion.") class TestHTML5LibEncodingConversion(TestLXMLBuilderEncodingConversion): -- cgit v1.2.3