Closed fmariluis closed 8 years ago
I looked into this. I couldn't find a fix for green that wouldn't break something under some other condition or in some other version of Python.
BUT I did find a good workaround for you: Start your docstring with u"""
-- that causes the docstring to be correctly parsed in all versions of Python.
# -*- coding: utf-8 -*-
import unittest
class TestGrammar(unittest.TestCase):
def test_one(self):
u"""
Ésto va a fallar.
"""
one = 1
two = 1
self.assertEqual(one, two)
if __name__ == '__main__':
unittest.main()
The 'correct'/other solution is to use from __future__ import unicode_literals
@jayvdb That's a much nicer workaround. Thanks!
Hi,
When parsing a docstring that includes a UTF-8 encoded character, Green fails with UnicodeDecodeError.
For example:
Works fine.
But:
Fails with:
A possible workaround is to decode
test._testMethodDoc
with 'utf8':Now it works:
But I don't know if this solution is overall acceptable.