Jeremiah Lowin commited on
Commit
4dfc4be
·
1 Parent(s): 67d0f98

Update test_types.py

Browse files
Files changed (1) hide show
  1. tests/utilities/test_types.py +11 -0
tests/utilities/test_types.py CHANGED
@@ -245,3 +245,14 @@ class TestFindKwargByType:
245
  pass
246
 
247
  assert find_kwarg_by_type(func, BaseClass) == "b"
 
 
 
 
 
 
 
 
 
 
 
 
245
  pass
246
 
247
  assert find_kwarg_by_type(func, BaseClass) == "b"
248
+
249
+ def test_nonstandard_annotation(self):
250
+ """Test finding parameter with a nonstandard annotation like an
251
+ instance. This is irregular."""
252
+
253
+ SENTINEL = object()
254
+
255
+ def func(a: int, b: SENTINEL, c: str): # type: ignore
256
+ pass
257
+
258
+ assert find_kwarg_by_type(func, SENTINEL) is None # type: ignore