Strange output with non-ascii string
See original GitHub issuePlatform: Windows 10 64bit Python: 3.7 Shell: Powershell 6.1.1
Test code:
#test_green.py
from unittest import TestCase
class OutputTests(TestCase):
def test_success(self):
self.assertEqual("lang: 日本語", "lang: 日本語")
def test_fail(self):
self.assertEqual("lang: 日本語", "lang: English")
Output by Green
:
test_green OutputTests F test_fail . test_success
Failure in test_green.OutputTests.test_fail // Traceback here AssertionError: 'lang: Ri Ben Yu ’ != ‘lang: English’ - lang: Ri Ben Yu + lang: English
Ran 2 tests in 0.740s
FAILED (failures=1, passes=1)
Output by builtin unittest
:
F.
====================================================================== FAIL: test_fail (test_green.OutputTests) ---------------------------------------------------------------------- //Traceback here AssertionError: ‘lang: 日本語’ != ‘lang: English’ - lang: 日本語 + lang: English
---------------------------------------------------------------------- Ran 2 tests in 0.002s
FAILED (failures=1)
Test finished as expected, but that is wrong output(日本語
->Ri Ben Yu
).
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Fix is in 2.14.0, just released.
Yes, I think so. Current behavior is not documented and may lead to confusion. The same output as builtin
unittest
is required.