Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail with latest lxml 4.7.1 due to extra newlines #8

Closed
mauritsvanrees opened this issue Jan 13, 2022 · 2 comments · Fixed by #9
Closed

Tests fail with latest lxml 4.7.1 due to extra newlines #8

mauritsvanrees opened this issue Jan 13, 2022 · 2 comments · Fixed by #9

Comments

@mauritsvanrees
Copy link
Member

mauritsvanrees commented Jan 13, 2022

In issue #7 I said I would add a separate issue for this, but promptly forgot it.

The failures are in these three tests:

repoze.xmliter.tests.TestIterator.test_getHTMLSerializer_doctype_xhtml_serializes_to_xhtml
repoze.xmliter.tests.TestIterator.test_replace_doctype
repoze.xmliter.tests.TestIterator.test_replace_doctype_blank

Sample error, note the extra newlines at the end:

b'<!D[194 chars]>Hello, w&#246;rld!<img src="foo.png" /></body>\n</html>\n' != b'<!D[194 chars]>Hello, w&#246;rld!<img src="foo.png" /></body>\n</html>\n\n\n'

  File "/srv/python3.9/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/srv/python3.9/lib/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/srv/python3.9/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/home/jenkins/.buildout/eggs/cp39/repoze.xmliter-0.6-py3.9.egg/repoze/xmliter/tests.py", line 167, in test_replace_doctype
    self.assertEqual(
  File "/srv/python3.9/lib/python3.9/unittest/case.py", line 837, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/srv/python3.9/lib/python3.9/unittest/case.py", line 830, in _baseAssertEqual
    raise self.failureException(msg)

See this Plone Jenkins PR job.

Looks easy to fix at first glance, just strip the result, and I can make a PR. But let's get some reactions on the other more general issue first.

@tseaver
Copy link
Member

tseaver commented Jan 13, 2022

@mauritsvanrees I would do the proposed fix ASAP, and push a 0.6.1 release.

@mauritsvanrees
Copy link
Member Author

PR created: #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants