'Make sure we cannot call the Factor linear regression method on factors
or slices that are not of float or int dtype.'

def test_regression_method_bad_type(self):

    returns_length = 2
    regression_length = 10
    returns = Returns(window_length=returns_length, inputs=[self.col])
    returns_slice = returns[self.my_asset]
    class BadTypeFactor(CustomFactor, ):
        window_length = 1
        inputs = []
        dtype = datetime64ns_dtype
        window_safe = True
        def compute(self, today, assets, out):
            pass
    bad_type_factor = BadTypeFactor()
    bad_type_factor_slice = bad_type_factor[self.my_asset]
    with self.assertRaises(TypeError):
        bad_type_factor.linear_regression(target=returns_slice, regression_length=regression_length)
    with self.assertRaises(TypeError):
        returns.linear_regression(target=bad_type_factor_slice, regression_length=regression_length)
