def test_invalid_encoder(self):
    """Verify we get an exception when trying to register invalid encoder."""
    with self.assertRaises(TypeError):
      encoder_registry.register_encoder('invalid_encoder')(InvalidEncoder)  # pytype: disable=wrong-arg-types
Verify we get an exception when trying to register invalid encoder.
language/mentionmemory/encoders/encoder_registry_test.py