From 81e23e7cc6d9ed9e0766324eb7a3be277e76385b Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 3 Nov 2023 15:23:33 +0300 Subject: [PATCH 1/2] gh-111681: minor fixes to typing doctests; remove unused imports in `test_typing` (#111682) Co-authored-by: Alex Waygood --- Doc/library/typing.rst | 2 +- Lib/test/test_typing.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 7b75094b9da0f6..b00eb93f32ece4 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1941,7 +1941,7 @@ without the dedicated syntax, as documented below. .. doctest:: - >>> from typing import ParamSpec + >>> from typing import ParamSpec, get_origin >>> P = ParamSpec("P") >>> get_origin(P.args) is P True diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 62fe00b0a02f28..e13ef795aff2b2 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -9,8 +9,7 @@ import pickle import re import sys -import warnings -from unittest import TestCase, main, skipUnless, skip +from unittest import TestCase, main, skip from unittest.mock import patch from copy import copy, deepcopy @@ -45,7 +44,7 @@ import weakref import types -from test.support import import_helper, captured_stderr, cpython_only +from test.support import captured_stderr, cpython_only from test.typinganndata import mod_generics_cache, _typed_dict_helper From 1f377f3c0c8679c7210596368bf88da5510d1cc1 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 9 Nov 2023 16:42:58 +0000 Subject: [PATCH 2/2] fixup --- Lib/test/test_typing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index e13ef795aff2b2..ca10a87b06130d 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -9,6 +9,7 @@ import pickle import re import sys +import warnings from unittest import TestCase, main, skip from unittest.mock import patch from copy import copy, deepcopy