From 2e9c0316bae1a0d93ad956cd4734e0ad76659a27 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 29 Aug 2022 03:45:24 +0300 Subject: [PATCH] gh-96357: Improve `typing.get_overloads` coverage (GH-96358) (cherry picked from commit 675e3470ccf3804a36a9cd451b813e9bd655aeb3) Co-authored-by: Nikita Sobolev --- Lib/test/test_typing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 2fd57822726e56..1a1ba3ef08e9d1 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -4410,6 +4410,9 @@ def some_other_func(): pass other_overload = some_other_func def some_other_func(): pass self.assertEqual(list(get_overloads(some_other_func)), [other_overload]) + # Unrelated function still has no overloads: + def not_overloaded(): pass + self.assertEqual(list(get_overloads(not_overloaded)), []) # Make sure that after we clear all overloads, the registry is # completely empty.