Skip to content

Commit 27c8060

Browse files
committed
BUG: Make unittest.mock.Mock not appear callable
1 parent f358893 commit 27c8060

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pdoc/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
cast, Any, Callable, Dict, Generator, Iterable, List, Mapping, NewType,
2727
Optional, Set, Tuple, Type, TypeVar, Union,
2828
)
29+
from unittest.mock import Mock
2930
from warnings import warn
3031

3132
from mako.lookup import TemplateLookup
@@ -410,7 +411,7 @@ def _is_public(ident_name):
410411

411412

412413
def _is_function(obj):
413-
return inspect.isroutine(obj) and callable(obj)
414+
return inspect.isroutine(obj) and callable(obj) and not isinstance(obj, Mock)
414415

415416

416417
def _is_descriptor(obj):

0 commit comments

Comments
 (0)