]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 1 Feb 2024 12:08:52 +0000 (13:08 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 12:08:52 +0000 (12:08 +0000)
(cherry picked from commit 0bf42dae7e73febc76ea96fd58af6b765a12b8a7)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Lib/ctypes/test/test_as_parameter.py

index aaaf6e2ceb0e83b6c3129b45d3440a92f96f4ca3..457643f5160d98acde83826dde53ea8c8d0cbddb 100644 (file)
@@ -227,5 +227,16 @@ class AsParamPropertyWrapperTestCase(BasicWrapTestCase):
 
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+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()