summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS.txt4
-rw-r--r--bs4/tests/test_soup.py7
2 files changed, 7 insertions, 4 deletions
diff --git a/NEWS.txt b/NEWS.txt
index 3557891..84365e7 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,8 @@
= 4.1.3 (20120820) =
-* Skipped a test under Python 2.6 to avoid a spurious test failure. [bug=1038503]
+* Skipped a test under Python 2.6 and Python 3.1 to avoid a spurious
+ test failure caused by the lousy HTMLParser in those
+ versions. [bug=1038503]
* Raise a more specific error (FeatureNotFound) when a requested
parser or parser feature is not installed. Raise NotImplementedError
diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py
index 2ccac33..dd636d8 100644
--- a/bs4/tests/test_soup.py
+++ b/bs4/tests/test_soup.py
@@ -28,7 +28,8 @@ try:
except ImportError, e:
LXML_PRESENT = False
-PRE_2_7 = (sys.version_info < (2,7))
+PYTHON_2_PRE_2_7 = (sys.version_info < (2,7))
+PYTHON_3_PRE_3_2 = (sys.version_info[0] == 3 and sys.version_info < (3,2))
class TestDeprecatedConstructorArguments(SoupTest):
@@ -179,8 +180,8 @@ class TestEncodingConversion(SoupTest):
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.")
+ PYTHON_2_PRE_2_7 or PYTHON_3_PRE_3_2,
+ "Bad HTMLParser detected; 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"))