Updated test for python 2.7

This commit is contained in:
Victor 2018-06-30 16:11:20 +02:00
parent a6636fddcd
commit 3a1c15316b
1 changed files with 5 additions and 2 deletions

View File

@ -842,10 +842,13 @@ def test_log_file_unicode(testdir):
) )
testdir.makepyfile( testdir.makepyfile(
""" """
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging import logging
def test_log_file(): def test_log_file():
logging.getLogger('catchlog').info("Normal message") logging.getLogger('catchlog').info("Normal message")
logging.getLogger('catchlog').info("\u251c") logging.getLogger('catchlog').info("")
logging.getLogger('catchlog').info("Another normal message") logging.getLogger('catchlog').info("Another normal message")
""" """
) )
@ -858,7 +861,7 @@ def test_log_file_unicode(testdir):
with open(log_file, encoding="utf-8") as rfh: with open(log_file, encoding="utf-8") as rfh:
contents = rfh.read() contents = rfh.read()
assert "Normal message" in contents assert "Normal message" in contents
assert "\u251c" in contents assert six.unichr(0x251c) in contents
assert "Another normal message" in contents assert "Another normal message" in contents