def test_adapt_fails(self):
    'Test that calling adapt leads to a runtime error.'
    input_dataset = {'foo': 0}
    with tf.Graph().as_default():
        layer = AddingPreprocessingLayer()
        with self.assertRaisesRegex(RuntimeError, '`adapt` is only supported in tensorflow v2'):
            layer.adapt(input_dataset)
Test that calling adapt leads to a runtime error.
def test_adapt_fails(self):
    
    input_dataset = {'foo': 0}
    with tf.Graph().as_default():
        layer = AddingPreprocessingLayer()
        with self.assertRaisesRegex(RuntimeError, '`adapt` is only supported in tensorflow v2'):
            layer.adapt(input_dataset)