summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-02-01 12:08:52 (GMT)
committerGitHub <noreply@github.com>2024-02-01 12:08:52 (GMT)
commit99796356125bfcfb3d2e555b5e82337b01556d36 (patch)
treec486bb29c7cd8a1681ce6b98637753b9f25727e3
parent8d2a193cf6e15659ee2cc94a757101764effbfa1 (diff)
downloadcpython-99796356125bfcfb3d2e555b5e82337b01556d36.zip
cpython-99796356125bfcfb3d2e555b5e82337b01556d36.tar.gz
cpython-99796356125bfcfb3d2e555b5e82337b01556d36.tar.bz2
[3.11] gh-107461 ctypes: Add a testcase for nested `_as_parameter_` lookup (GH-107462) (GH-114859)
(cherry picked from commit 0bf42dae7e73febc76ea96fd58af6b765a12b8a7) Co-authored-by: Tomas R <tomas.roun8@gmail.com>
-rw-r--r--Lib/ctypes/test/test_as_parameter.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/ctypes/test/test_as_parameter.py
index aaaf6e2..457643f 100644
--- a/Lib/ctypes/test/test_as_parameter.py
+++ b/Lib/ctypes/test/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()