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

New ALLOW_UNICODE doctest option #938

Merged
merged 3 commits into from
Aug 16, 2015

Conversation

nicoddemus
Copy link
Member

Code and option copied from the nltk project.

Fixes #710.

cc @jaraco

When enabled, the ``u`` prefix is stripped from unicode strings in
expected doctest output. This allows doctests which use unicode
to run in Python 2 and 3 unchanged.

Fix pytest-dev#710
Also make sure a test that doesn't set ALLOW_UNICODE fails
on Python 2 and passes Python 3.
@nicoddemus
Copy link
Member Author

Any comments here @RonnyPfannschmidt?

RonnyPfannschmidt added a commit that referenced this pull request Aug 16, 2015
New ALLOW_UNICODE doctest option
@RonnyPfannschmidt RonnyPfannschmidt merged commit 37ed391 into pytest-dev:master Aug 16, 2015
@jaraco
Copy link
Contributor

jaraco commented Aug 16, 2015

I've been meaning to test this in the fork. Now I'll plan to test it here. Thanks to both and I really look forward to this feature.

@jaraco
Copy link
Contributor

jaraco commented Aug 16, 2015

The test works great on a known failing project. Thanks for this.

It is slightly awkward that passing ALLOW_UNICODE causes tests to fail without this patch, but I guess that's an acceptable limitation, and certainly understandable.

@pfctdayelise
Copy link
Contributor

@jaraco, you can set in your config file to have ALLOW_UNICODE enabled by default. Would make sense if you use a lot of doctests on strings and have py2/3 support. :)

@nicoddemus nicoddemus deleted the doctest-unicode branch August 17, 2015 21:37
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.

4 participants