From: Toni Karppi Date: Thu, 21 Feb 2019 11:51:21 +0000 (+0100) Subject: Add test to as_interface when no cls or methods X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4512%2Fhead;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add test to as_interface when no cls or methods The `as_interface` function requires that an argument be provided for at least one of the parameters `cls` or `methods`. There was no test that tested the case when neither of these arguments were provided. --- diff --git a/test/base/test_utils.py b/test/base/test_utils.py index b27379248d..e96162703b 100644 --- a/test/base/test_utils.py +++ b/test/base/test_utils.py @@ -2305,6 +2305,10 @@ class AsInterfaceTest(fixtures.TestBase): class Object(object): pass + def test_no_cls_no_methods(self): + obj = object() + assert_raises(TypeError, util.as_interface, obj) + def test_instance(self): obj = object() assert_raises(TypeError, util.as_interface, obj, cls=self.Something)