def test_readInvalidUTF8Bytes(self) -> None:
    '\n        If the JSON text for a record contains invalid UTF-8 text, ignore that\n        record.\n        '
    with BytesIO(b'\x1e{"x": "\xe2\xac"}\n\x1e{"y": 2}\n') as fileHandle:
        events = iter(eventsFromJSONLogFile(fileHandle))
        self.assertEqual(next(events), {'y': 2})
        self.assertRaises(StopIteration, next, events)
        self.assertEqual(len(self.errorEvents), 1)
        self.assertEqual(self.errorEvents[0]['log_format'], 'Unable to decode UTF-8 for JSON record: {record!r}')
        self.assertEqual(self.errorEvents[0]['record'], b'{"x": "\xe2\xac"}\n')
If the JSON text for a record contains invalid UTF-8 text, ignore that
record.
def test_readInvalidUTF8Bytes(self) -> None:
    '\n        If the JSON text for a record contains invalid UTF-8 text, ignore that\n        record.\n        '
    with BytesIO(b'\x1e{"x": "\xe2\xac"}\n\x1e{"y": 2}\n') as fileHandle:
        events = iter(eventsFromJSONLogFile(fileHandle))
        self.assertEqual(next(events), {'y': 2})
        self.assertRaises(StopIteration, next, events)
        self.assertEqual(len(self.errorEvents), 1)
        self.assertEqual(self.errorEvents[0]['log_format'], 'Unable to decode UTF-8 for JSON record: {record!r}')
        self.assertEqual(self.errorEvents[0]['record'], b'{"x": "\xe2\xac"}\n')