From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:06:08 +0000 (+0100) Subject: [3.12] gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462... X-Git-Tag: v3.12.2~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0cf136c9a0fbc263b090504c807ea27030ef0bcd;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462) (GH-114858) (cherry picked from commit 0bf42dae7e73febc76ea96fd58af6b765a12b8a7) Co-authored-by: Tomas R --- diff --git a/Lib/test/test_ctypes/test_as_parameter.py b/Lib/test/test_ctypes/test_as_parameter.py index 36fec572b167..27a5d3ac0643 100644 --- a/Lib/test/test_ctypes/test_as_parameter.py +++ b/Lib/test/test_ctypes/test_as_parameter.py @@ -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()