summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorsobolevn <mail@sobolevn.me>2025-01-08 12:04:54 (GMT)
committerGitHub <noreply@github.com>2025-01-08 12:04:54 (GMT)
commit74a517181a9bb65a1f6da149af7427a9fcb3add3 (patch)
tree4be465bb8bfa2bdd687e07365f3e3e64901691c4 /Lib/test
parent95cd9c669cdc7718198addb1abb49941a2c61fae (diff)
downloadcpython-74a517181a9bb65a1f6da149af7427a9fcb3add3.zip
cpython-74a517181a9bb65a1f6da149af7427a9fcb3add3.tar.gz
cpython-74a517181a9bb65a1f6da149af7427a9fcb3add3.tar.bz2
gh-128615: Cover pickling of `ParamSpecArgs` and `ParamSpecKwargs` (#128616)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_typing.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index a75dac4..45ba761 100644
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -5182,6 +5182,18 @@ class GenericTests(BaseTestCase):
x = pickle.loads(z)
self.assertEqual(s, x)
+ # Test ParamSpec args and kwargs
+ global PP
+ PP = ParamSpec('PP')
+ for thing in [PP.args, PP.kwargs]:
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ with self.subTest(thing=thing, proto=proto):
+ self.assertEqual(
+ pickle.loads(pickle.dumps(thing, proto)),
+ thing,
+ )
+ del PP
+
def test_copy_and_deepcopy(self):
T = TypeVar('T')
class Node(Generic[T]): ...