def test_return_none(self, fn, args): """Test that fn of Mixin returns None. Args: fn: fn of Mixin to test args: arguments to fn of Mixin """ loss = StrongConvexMixin() ret = getattr(loss, fn, None)(*args) self.assertEqual(ret, None)
def test_not_implemented(self, fn, args): """Test that the given fn's are not implemented on the mixin. Args: fn: fn on Mixin to test args: arguments to fn of Mixin """ with self.assertRaises(NotImplementedError): loss = StrongConvexMixin() getattr(loss, fn, None)(*args)