Fix log printing for python3 by converting everything to unicode.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
a348993d2c
commit
9d9550c5b6
4 changed files with 21 additions and 21 deletions
|
|
@ -12,7 +12,7 @@ from tests import unittest
|
|||
class LogPrinterTest(unittest.TestCase):
|
||||
def get_default_output(self, monochrome=False):
|
||||
def reader(*args, **kwargs):
|
||||
yield "hello\nworld"
|
||||
yield b"hello\nworld"
|
||||
|
||||
container = MockContainer(reader)
|
||||
output = run_log_printer([container], monochrome=monochrome)
|
||||
|
|
@ -36,11 +36,10 @@ class LogPrinterTest(unittest.TestCase):
|
|||
glyph = u'\u2022'
|
||||
|
||||
def reader(*args, **kwargs):
|
||||
yield glyph + '\n'
|
||||
yield glyph.encode('utf-8') + b'\n'
|
||||
|
||||
container = MockContainer(reader)
|
||||
output = run_log_printer([container])
|
||||
|
||||
if six.PY2:
|
||||
output = output.decode('utf-8')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue