def test_exception_record(self):
    formatter = logger.JsonLogFormatter(job_id='jobid', worker_id='workerid')
    try:
      raise ValueError('Something')
    except __HOLE__:
      attribs = dict(self.SAMPLE_RECORD)
      attribs.update({'exc_info': sys.exc_info()})
      record = self.create_log_record(**attribs)
    log_output = json.loads(formatter.format(record))
    # Check if exception type, its message, and stack trace information are in.
    exn_output = log_output.pop('exception')
    self.assertNotEqual(exn_output.find('ValueError: Something'), -1)
    self.assertNotEqual(exn_output.find('logger_test.py'), -1)
    self.assertEqual(log_output, self.SAMPLE_OUTPUT)
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/worker/logger_test.py/JsonLogFormatterTest.test_exception_record