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

Port all doctest to python 3 #2268

Closed
pbauer opened this issue Jan 26, 2018 · 0 comments
Closed

Port all doctest to python 3 #2268

pbauer opened this issue Jan 26, 2018 · 0 comments

Comments

@pbauer
Copy link
Member

pbauer commented Jan 26, 2018

As discussed in #2217 and #2184 (comment) doctests are not handled when using sixer.

So we need to go through all our packages again and start migrating doctests like this

$ sixer all -w src/Products/CMFPlone/tests/*.txt

sixer does for some reason not really fix doctests, so you will have to do that by hand 😭

Getting doctest compatible with py2 and py3 can be hard though. What can help is using regex patterns to normalize the output as described in https://github.com/zopefoundation/zope.testing/blob/master/src/zope/testing/renormalizing.txt. Examples of how that is used can be found in https://github.com/zestsoftware/zest.releaser/blob/master/zest/releaser/tests/test_setup.py#L43

The best long-term option though is to port all doctests (that are not actually testing documentation) to unittests.

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

No branches or pull requests

1 participant