diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-20 12:40:35 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-20 12:40:35 -0500 |
commit | 614baaff5871c95afcfbfee431b0ef0b23123721 (patch) | |
tree | c416aaf17893b0f5ba17485373a6a72298e42755 /bs4/tests/test_tree.py | |
parent | 85baeb52b43c5d61dd7cc274ca9c31972ae88bfc (diff) |
Temporarily skip the deepcopy test when lxml is not installed.
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r-- | bs4/tests/test_tree.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 5d5ca9a..d6d8dcb 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -14,7 +14,10 @@ import pickle import re import warnings from bs4 import BeautifulSoup -from bs4.builder import builder_registry +from bs4.builder import ( + builder_registry, + HTMLParserTreeBuilder, +) from bs4.element import CData, NavigableString, SoupStrainer, Tag from bs4.testing import ( SoupTest, @@ -22,7 +25,7 @@ from bs4.testing import ( ) XML_BUILDER_PRESENT = (builder_registry.lookup("xml") is not None) - +LXML_PRESENT = (builder_registry.lookup("lxml") is not None) class TreeTest(SoupTest): @@ -1119,6 +1122,8 @@ class TestPersistence(SoupTest): self.assertEqual(loaded.__class__, BeautifulSoup) self.assertEqual(loaded.decode(), self.tree.decode()) + @skipIf(not LXML_PRESENT, + "Skipping deepcopy test to work around htmlparser bug.") def test_deepcopy_identity(self): # Making a deepcopy of a tree yields an identical tree. copied = copy.deepcopy(self.tree) |