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

Fix doctest failures #433

Merged
merged 1 commit into from Jan 9, 2019
Merged

Fix doctest failures #433

merged 1 commit into from Jan 9, 2019

Conversation

willkg
Copy link
Member

@willkg willkg commented Jan 8, 2019

This reworks the doctests to run and pass in Python 3.

Fixes #357

This reworks the doctests to run and pass in Python 3.

Fixes #357
@@ -353,7 +353,7 @@ Trivial Filter example:
.. doctest::

>>> from bleach.sanitizer import Cleaner
>>> from html5lib.filters.base import Filter
>>> from bleach.html5lib_shim import Filter
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is interesting. What's going on is that we vendored html5lib, so it's no longer installed as a requirement. That's cool, but that means it's not installed anymore. I switched it to use the bleach.html5lib_shim module. It's the same Filter class, but it's specifically the one that ships with Bleach. That's more correct. I'm not sure if it feels weird to be importing it from a module named bleach.html5lib_shim or not. It's probably fine.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wfm

@willkg willkg requested a review from g-k January 9, 2019 14:39
Copy link
Collaborator

@g-k g-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ 👍

@@ -353,7 +353,7 @@ Trivial Filter example:
.. doctest::

>>> from bleach.sanitizer import Cleaner
>>> from html5lib.filters.base import Filter
>>> from bleach.html5lib_shim import Filter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wfm

@willkg willkg merged commit 948b745 into mozilla:master Jan 9, 2019
@willkg
Copy link
Member Author

willkg commented Jan 9, 2019

Thank you!

@willkg willkg deleted the 357-doctest branch January 9, 2019 14:57
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 this pull request may close these issues.

None yet

2 participants