diff options
-rw-r--r-- | NEWS.txt | 8 | ||||
-rw-r--r-- | bs4/tests/test_soup.py | 6 |
2 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,9 @@ += 4.1.3 (20120820) = + +* Skipped a test under Python 2.6 to avoid a spurious test failure. [bug=1038503] + +* + = 4.1.2 (20120817) = * As per PEP-8, allow searching by CSS class using the 'class_' @@ -10,7 +16,7 @@ non-ASCII characters. * When sniffing encodings, if the cchardet library is installed, - Beautiful Soup uses cchardet instead of chardet. cchardet is much + Beautiful Soup uses it instead of chardet. cchardet is much faster. [bug=1020748] * Use logging.warning() instead of warning.warn() to notify the user diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index 9cbc80f..2ccac33 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -3,6 +3,7 @@ import logging import unittest +import sys from bs4 import ( BeautifulSoup, BeautifulStoneSoup, @@ -27,6 +28,8 @@ try: except ImportError, e: LXML_PRESENT = False +PRE_2_7 = (sys.version_info < (2,7)) + class TestDeprecatedConstructorArguments(SoupTest): def test_parseOnlyThese_renamed_to_parse_only(self): @@ -175,6 +178,9 @@ class TestEncodingConversion(SoupTest): soup_from_unicode = self.soup(self.unicode_data) self.assertEqual(soup_from_unicode.encode('utf-8'), self.utf8_data) + @skipIf( + PRE_2_7, + "HTMLParser is pre-2.7; skipping test of non-ASCII characters in attribute name.") def test_attribute_name_containing_unicode_characters(self): markup = u'<div><a \N{SNOWMAN}="snowman"></a></div>' self.assertEqual(self.soup(markup).div.encode("utf8"), markup.encode("utf8")) |