summaryrefslogtreecommitdiff
path: root/beautifulsoup/testing.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2011-01-28 13:30:40 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2011-01-28 13:30:40 -0500
commit5d4b8cc6d288a705cf87c2f2c26036b94d825aa9 (patch)
tree33a12e789fc659022d9fca2eb84c6135b81d1c23 /beautifulsoup/testing.py
parent4b980a8ceb23198a840bb514c8de16ef41fbb036 (diff)
Refactored enough to get all of the tests to pass with test discovery, even though there are still some underlying problems.
Diffstat (limited to 'beautifulsoup/testing.py')
-rw-r--r--beautifulsoup/testing.py13
1 files changed, 7 insertions, 6 deletions
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 <p> tag around the bare string.
+ self.assertSoupEquals(
+ "A bare string", "<p>A bare string</p>")
def test_mixed_case_tags(self):
# Mixed-case tags are folded to lowercase.