]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462)
authorTomas R <tomas.roun8@gmail.com>
Thu, 1 Feb 2024 11:49:01 +0000 (12:49 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 11:49:01 +0000 (13:49 +0200)
Lib/test/test_ctypes/test_as_parameter.py

index a1a8745e737fa25de7be658d153bb98cee3fdc10..ca75e748256083b4983539f5791e12380c23ad98 100644 (file)
@@ -221,5 +221,16 @@ class AsParamPropertyWrapperTestCase(BasicWrapTestCase):
     wrap = AsParamPropertyWrapper
 
 
+class AsParamNestedWrapperTestCase(BasicWrapTestCase):
+    """Test that _as_parameter_ is evaluated recursively.
+
+    The _as_parameter_ attribute can be another object which
+    defines its own _as_parameter_ attribute.
+    """
+
+    def wrap(self, param):
+        return AsParamWrapper(AsParamWrapper(AsParamWrapper(param)))
+
+
 if __name__ == '__main__':
     unittest.main()