From 49d7bc92ffac8178f73a7a55984e2481bb24c0bb Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sun, 4 May 2025 14:32:52 -0400 Subject: [PATCH] Update test_types.py --- tests/utilities/test_types.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/utilities/test_types.py b/tests/utilities/test_types.py index 43f0a9725..ef4c8716d 100644 --- a/tests/utilities/test_types.py +++ b/tests/utilities/test_types.py @@ -245,3 +245,14 @@ class TestFindKwargByType: pass assert find_kwarg_by_type(func, BaseClass) == "b" + + def test_nonstandard_annotation(self): + """Test finding parameter with a nonstandard annotation like an + instance. This is irregular.""" + + SENTINEL = object() + + def func(a: int, b: SENTINEL, c: str): # type: ignore + pass + + assert find_kwarg_by_type(func, SENTINEL) is None # type: ignore