def test_invalid_task(self):
    """Verify we get an exception when trying to register invalid task."""
    with self.assertRaises(TypeError):
      task_registry.register_task('invalid_task')(InvalidTask)  # pytype: disable=wrong-arg-types
Verify we get an exception when trying to register invalid task.
language/mentionmemory/tasks/task_registry_test.py