]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add test to as_interface when no cls or methods 4512/head
authorToni Karppi <karppitoni@gmail.com>
Thu, 21 Feb 2019 11:51:21 +0000 (12:51 +0100)
committerToni Karppi <karppitoni@gmail.com>
Thu, 21 Feb 2019 11:51:21 +0000 (12:51 +0100)
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.

test/base/test_utils.py

index b27379248d3bfdc2546a32516fc16de7facf0f47..e96162703bc6f05000c322174de0f2951ef22a1f 100644 (file)
@@ -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)