From: Tomas R Date: Thu, 1 Feb 2024 11:49:01 +0000 (+0100) Subject: gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462) X-Git-Tag: v3.13.0a4~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bf42dae7e73febc76ea96fd58af6b765a12b8a7;p=thirdparty%2FPython%2Fcpython.git gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462) --- diff --git a/Lib/test/test_ctypes/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py index a1a8745e737f..ca75e7482560 100644 --- a/Lib/test/test_ctypes/test_as_parameter.py +++ b/Lib/test/test_ctypes/test_as_parameter.py @@ -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()