Remove unicode literal compat code

This commit is contained in:
Thomas Hisch 2017-09-26 23:27:38 +02:00
parent 1f3ab118fa
commit 815dd19fb4
1 changed files with 4 additions and 7 deletions

View File

@ -1,13 +1,10 @@
# -*- coding: utf-8 -*-
import sys
import logging
logger = logging.getLogger(__name__)
sublogger = logging.getLogger(__name__+'.baz')
u = (lambda x: x.decode('utf-8')) if sys.version_info < (3,) else (lambda x: x)
def test_fixture_help(testdir):
result = testdir.runpytest('--fixtures')
@ -60,14 +57,14 @@ def test_record_tuples(caplog):
def test_unicode(caplog):
logger.info(u(''))
logger.info(u'')
assert caplog.records[0].levelname == 'INFO'
assert caplog.records[0].msg == u('')
assert u('') in caplog.text
assert caplog.records[0].msg == u''
assert u'' in caplog.text
def test_clear(caplog):
logger.info(u(''))
logger.info(u'')
assert len(caplog.records)
caplog.clear()
assert not len(caplog.records)