code: def test_log_and_raise(self, msg, cls):
      with mock.patch.object(logging, "error") as mock_logging:
          with self.assertRaisesRegexp(cls, msg):
              errors.log_and_raise(msg, cls)
          mock_logging.assert_called_once_with(msg)
  
file_path: deepvariant/third_party/nucleus/util/errors_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import errno
  import sys
  from absl import logging
  from absl.testing import absltest
  from absl.testing import parameterized
  import mock
  from third_party.nucleus.util import errors
label_desc: Use image node_id 1 for calling the ErrorsTest obj's underlying member method code with example usage: obj.test_log_and_raise(msg, cls) without return types