(self)
| 92 | self.assertEqual(self.get_output(), utf8(repr(b"\xe9"))) |
| 93 | |
| 94 | def test_utf8_logging(self): |
| 95 | with ignore_bytes_warning(): |
| 96 | self.logger.error(u"\u00e9".encode("utf8")) |
| 97 | if issubclass(bytes, basestring_type): |
| 98 | # on python 2, utf8 byte strings (and by extension ascii byte |
| 99 | # strings) are passed through as-is. |
| 100 | self.assertEqual(self.get_output(), utf8(u"\u00e9")) |
| 101 | else: |
| 102 | # on python 3, byte strings always get repr'd even if |
| 103 | # they're ascii-only, so this degenerates into another |
| 104 | # copy of test_bytes_logging. |
| 105 | self.assertEqual(self.get_output(), utf8(repr(utf8(u"\u00e9")))) |
| 106 | |
| 107 | def test_bytes_exception_logging(self): |
| 108 | try: |
nothing calls this directly
no test coverage detected