diff options
Diffstat (limited to 'sphinx/ext/autodoc/mock.py')
-rw-r--r-- | sphinx/ext/autodoc/mock.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sphinx/ext/autodoc/mock.py b/sphinx/ext/autodoc/mock.py index 36b2836f3..7bd0b1ea0 100644 --- a/sphinx/ext/autodoc/mock.py +++ b/sphinx/ext/autodoc/mock.py @@ -154,6 +154,11 @@ def mock(modnames: List[str]) -> Generator[None, None, None]: finder.invalidate_caches() +def ismockmodule(subject: Any) -> bool: + """Check if the object is a mocked module.""" + return isinstance(subject, _MockModule) + + def ismock(subject: Any) -> bool: """Check if the object is mocked.""" # check the object has '__sphinx_mock__' attribute |