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

Error messages on Windows breaks on Unicode #119

Closed
MinchinWeb opened this issue Apr 9, 2016 · 2 comments
Closed

Error messages on Windows breaks on Unicode #119

MinchinWeb opened this issue Apr 9, 2016 · 2 comments

Comments

@MinchinWeb
Copy link
Contributor

Windows has various issues around Unicode. The particular issue I'm running into with green is a test will fail due to a unicode issue (often the program under test will attempt to print something unicode to CMD), but when green tries to print the resulting error message, it breaks as the error message contains the unicode character in question. Thus, I only learn of the first test that failed, and not why any of the tests after that failed.

Would it be possible to run the error messages through something like Unidecode, at least on Windows, before dumping it to CMD?

@CleanCut
Copy link
Owner

Fine with me. Did you want to submit a pull request? If not, it would be
helpful if you could send me one of the crash cases.
On Fri, Apr 8, 2016 at 10:21 PM MinchinWeb notifications@github.com wrote:

Windows has various issues around Unicode. The particular issue I'm
running into with green is a test will fail due to a unicode issue (often
the program under test will attempt to print something unicode to CMD), but
when green tries to print the resulting error message, it breaks as the
error message contains the unicode character in question. Thus, I only
learn of the first test that failed, and not why any of the tests after
that failed.

Would it be possible to run the error messages through something like
Unidecode https://pypi.python.org/pypi/Unidecode, at least on Windows,
before dumping it to CMD?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#119

@MinchinWeb
Copy link
Contributor Author

Ok, I think I put together working code. I'm not sure how to add a test though... Here's what I'm using as a manual testcase on my end:

import unittest

class UnicodeTest(unittest.TestCase):
    def test1(self):
        print('\u03BB')  # lambda
        self.assertTrue(True)

    def test2(self):
        self.assertTrue(False)

And the output (with green working):

image

Suggestions?

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

2 participants