'Verify that the validate decorator doesn\'t swallow typeerrors that
would be raised when calling a function with invalid arguments'

@parameterized.expand([('too_many', (1, 2, 3), {}), ('too_few', (1,), {}), ('collision', (1,), {'a': 1}), ('unexpected', (1,), {'q': 1})])
def test_preprocess_doesnt_change_TypeErrors(self, name, args, kwargs):

    def undecorated(x, y):
        return (x, y)
    decorated = preprocess(x=noop, y=noop)(undecorated)
    with self.assertRaises(TypeError) as e:
        undecorated(*args, **kwargs)
    undecorated_errargs = e.exception.args
    with self.assertRaises(TypeError) as e:
        decorated(*args, **kwargs)
    decorated_errargs = e.exception.args
    self.assertEqual(len(decorated_errargs), 1)
    self.assertEqual(len(undecorated_errargs), 1)
    self.assertEqual(decorated_errargs[0], undecorated_errargs[0])
