-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add support for unicode literals to #710
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
Comments
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): If i am not mistaken, most current core committers do not use doctests much so you might consider adding necessary support yourself. Or maybe @charles or @HolgerPeters who did some relatively recent PR to the pytest doctest code can help. |
Original comment by Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco): I hear that this project exists as a standalone package supporting the behavior. Perhaps it could be extended to be a pytest plugin. |
@jaraco this one got lost under the rug, is it still needed, it seems easy enough to hand to a new contributor at first glance (i hope im right at least) |
It is still needed. I regularly have to massage my doctests to satisfy Python 2 or just let them fail on Python 2. This one issue creates a great deal of impedance for doctest authors, and if it could be addressed in the test runner, that would be such a delight. |
I'm using pytest to execute NLTK tests. |
as far as i can tell, all core developers would have to investigate this first |
It seems so. Just rising the awareness about this issue! |
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
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
Opened a PR at #938. The use case I used was:
You guys feel that is enough? |
@nicoddemus So awesome you're working this! I believe the use case should be sufficient. |
im under the impression the solution is to the spot |
Originally reported by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)
I like to use doctests for some use cases, and pytest makes inclusion of them in tests suites quite elegant.
However, doctests have a particularly hard problem with Python2/3 compatibility (because unicode strings render as u'' in Python 2 and '' in Python 3).
The NLTK project has built a nose plugin to better support the disparity.
I'd like to see pytest support this functionality as well.
The text was updated successfully, but these errors were encountered: