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
Fix doctest failures #433
Conversation
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wfm
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wfm
Thank you! |
This reworks the doctests to run and pass in Python 3.
Fixes #357