Minor style improvements

This commit is contained in:
Dave Hunt 2017-08-15 09:16:32 +01:00
parent b9309f1458
commit 0c442e43ae
2 changed files with 6 additions and 4 deletions

View File

@ -199,7 +199,7 @@ class HTMLReport(object):
elif extra.get('format') == extras.FORMAT_TEXT:
content = extra.get('content')
if isinstance(content, bytes):
content = content.decode("utf-8")
content = content.decode('utf-8')
if self.self_contained:
href = data_uri(content)
else:

View File

@ -239,7 +239,7 @@ class TestHTML:
@pytest.mark.parametrize('content, encoded', [
("u'\u0081'", 'woE='),
("'foo'", 'Zm9v'),
("b'\\xe2\\x80\\x93'", "4oCT")])
("b'\\xe2\\x80\\x93'", '4oCT')])
def test_extra_text(self, testdir, content, encoded):
testdir.makeconftest("""
import pytest
@ -326,8 +326,10 @@ class TestHTML:
src = 'data:{0};base64,{1}'.format(mime_type, content)
assert '<img src="{0}"/>'.format(src) in html
@pytest.mark.parametrize('content', [("u'\u0081'"), ("'foo'"),
("b'\\xe2\\x80\\x93'")])
@pytest.mark.parametrize('content', [
("u'\u0081'"),
("'foo'"),
("b'\\xe2\\x80\\x93'")])
def test_extra_text_separated(self, testdir, content):
testdir.makeconftest("""
import pytest