From 5d4b8cc6d288a705cf87c2f2c26036b94d825aa9 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Fri, 28 Jan 2011 13:30:40 -0500 Subject: Refactored enough to get all of the tests to pass with test discovery, even though there are still some underlying problems. --- beautifulsoup/testing.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'beautifulsoup/testing.py') diff --git a/beautifulsoup/testing.py b/beautifulsoup/testing.py index 20d087e..eea14f0 100644 --- a/beautifulsoup/testing.py +++ b/beautifulsoup/testing.py @@ -7,11 +7,9 @@ from beautifulsoup.builder.lxml_builder import LXMLTreeBuilder class SoupTest(unittest.TestCase): - def setUp(self): - # LXMLTreeBuilder won't handle bad markup, but that's fine, - # since all the parsing tests take place in parser-specific - # test suites that override default_builder. - self.default_builder = LXMLTreeBuilder() + @property + def default_builder(self): + return LXMLTreeBuilder() def soup(self, markup, **kwargs): """Build a Beautiful Soup object from markup.""" @@ -47,7 +45,10 @@ class BuilderSmokeTest(SoupTest): def test_bare_string(self): # A bare string is turned into some kind of HTML document or # fragment recognizable as the original string. - self.assertSoupEquals("A bare string") + # + # In this case, lxml puts a

tag around the bare string. + self.assertSoupEquals( + "A bare string", "

A bare string

") def test_mixed_case_tags(self): # Mixed-case tags are folded to lowercase. -- cgit v1.2.3