Skip to content

Commit

Permalink
Fix coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Mar 27, 2019
1 parent 0fb0120 commit f5f5973
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/zope/sendmail/maildir.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def newMessage(self):

def _encode_utf8(s):
if PY2 and isinstance(s, text_type):
s = s.encode('utf-8')
s = s.encode('utf-8') # pragma: PY2
return s


Expand Down
5 changes: 3 additions & 2 deletions src/zope/sendmail/tests/test_maildir.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,9 @@ def test_message_writer_unicode(self):
writer.write(u' fi\xe8')
writer.writelines([u' fo\xe8', u' fo\xf2'])
if PY2:
self.assertEqual(writer._fd._written,
'fe\xc3\xa8 fi\xc3\xa8 fo\xc3\xa8 fo\xc3\xb2')
self.assertEqual(
writer._fd._written,
'fe\xc3\xa8 fi\xc3\xa8 fo\xc3\xa8 fo\xc3\xb2') # pragma: PY2
else:
self.assertEqual(writer._fd._written,
'fe\xe8 fi\xe8 fo\xe8 fo\xf2')
Expand Down

0 comments on commit f5f5973

Please sign in to comment.