diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-04-26 07:32:53 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-04-26 07:32:53 -0400 |
commit | 3ff7bde5d320fbec4c16e7f245c345e8455ca887 (patch) | |
tree | 97f12ee78940b9a9e70b560182e6d3d8f33f0549 /bs4/tests/test_soup.py | |
parent | 2261264fb5b4cc8a9095a1b14a92b52258e8029e (diff) |
Fixed test failure when lxml is not installed.
Diffstat (limited to 'bs4/tests/test_soup.py')
-rw-r--r-- | bs4/tests/test_soup.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index 39e1964..94f325e 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -21,10 +21,10 @@ from bs4.testing import ( import warnings try: - import chardet - CHARDET_PRESENT = True + from bs4.builder import LXMLTreeBuilder, LXMLTreeBuilderForXML + LXML_PRESENT = True except ImportError, e: - CHARDET_PRESENT = False + LXML_PRESENT = False class TestDeprecatedConstructorArguments(SoupTest): @@ -49,6 +49,9 @@ class TestDeprecatedConstructorArguments(SoupTest): self.assertRaises( TypeError, self.soup, "<a>", no_such_argument=True) + @skipIf( + not LXML_PRESENT, + "lxml not present, not testing BeautifulStoneSoup.") def test_beautifulstonesoup(self): with warnings.catch_warnings(record=True) as w: soup = BeautifulStoneSoup("<markup>") |