Merge lp://qastaging/~saschpe/beautifulsoup/beautifulsoup into lp://qastaging/beautifulsoup

Proposed by Sascha Peilicke
Status: Needs review
Proposed branch: lp://qastaging/~saschpe/beautifulsoup/beautifulsoup
Merge into: lp://qastaging/beautifulsoup
Diff against target: 29 lines (+6/-1) (has conflicts)
2 files modified
bs4/testing.py (+1/-1)
bs4/tests/test_lxml.py (+5/-0)
Text conflict in bs4/tests/test_lxml.py
To merge this branch: bzr merge lp://qastaging/~saschpe/beautifulsoup/beautifulsoup
Reviewer Review Type Date Requested Status
Leonard Richardson Pending
Review via email: mp+200849@code.qastaging.launchpad.net

Description of the change

LXML fixes

To post a comment you must log in.

Unmerged revisions

324. By tar_scm test suite <root@localhost>

Fix lxml deprecation warning tests.

The class BeautifulStoneSoup is instanciated first in
bs4.tests.test_soup:LXMLTreeBuilderSmokeTest.test_beautifulstonesoup_is_xml_parser
causing the UserWarning to be printed once. However, the deprecation test will
fail afterwards:

ERROR: test_beautifulstonesoup (bs4.tests.test_soup.TestDeprecatedConstructorArguments)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/Projects/python/beautifulsoup/bs4/tests/test_soup.py", line 69, in test_beautifulstonesoup
    self.assertTrue("BeautifulStoneSoup class is deprecated" in str(w[0].message))
IndexError: list index out of range

Instead, don't eat the UserWarning in the first test so that the second one can
catch it properly.

323. By tar_scm test suite <root@localhost>

Don't provide encoding for XML unicode tests with LXML.

ERROR: test_can_parse_unicode_document (bs4.tests.test_lxml.LXMLXMLTreeBuilderSmokeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/Projects/python/beautifulsoup/bs4/testing.py", line 498, in test_can_parse_unicode_document
    self.assertEqual(u'Sacr\xe9 bleu!', soup.root.string)
AttributeError: 'NoneType' object has no attribute 'string'

As described at http://lxml.de/parsing.html#python-unicode-strings LXML doesn't like
Unicode XML that specifies a (wrong) encoding.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: