diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-10 17:40:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-10 17:40:39 (GMT) |
commit | b3074f0d5ec4ead75ecce10bf7b7a1459cbf892e (patch) | |
tree | 8da69770a0407734f335face51ce53c446f1f31b /Lib/test | |
parent | 6df49134b3f59a84c6d9a3883b23fa2873db2534 (diff) | |
download | cpython-b3074f0d5ec4ead75ecce10bf7b7a1459cbf892e.zip cpython-b3074f0d5ec4ead75ecce10bf7b7a1459cbf892e.tar.gz cpython-b3074f0d5ec4ead75ecce10bf7b7a1459cbf892e.tar.bz2 |
[3.13] Rename typing._collect_parameters (GH-118900) (#118917)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_typing.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index f6fe953..60fb4f5 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -45,7 +45,7 @@ import typing import weakref import types -from test.support import captured_stderr, cpython_only, infinite_recursion, requires_docstrings +from test.support import captured_stderr, cpython_only, infinite_recursion, requires_docstrings, import_helper from test.typinganndata import ann_module695, mod_generics_cache, _typed_dict_helper @@ -6325,6 +6325,8 @@ class ForwardRefTests(BaseTestCase): self.assertEqual(X | "x", Union[X, "x"]) self.assertEqual("x" | X, Union["x", X]) + +class InternalsTests(BaseTestCase): def test_deprecation_for_no_type_params_passed_to__evaluate(self): with self.assertWarnsRegex( DeprecationWarning, @@ -6350,6 +6352,15 @@ class ForwardRefTests(BaseTestCase): self.assertEqual(cm.filename, __file__) + def test_collect_parameters(self): + typing = import_helper.import_fresh_module("typing") + with self.assertWarnsRegex( + DeprecationWarning, + "The private _collect_parameters function is deprecated" + ) as cm: + typing._collect_parameters + self.assertEqual(cm.filename, __file__) + @lru_cache() def cached_func(x, y): |