module documentation

mock for autodoc

Unknown Field: copyright
Copyright 2007-2022 by the Sphinx team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Variable logger Undocumented
Class _​Mock​Module Used by autodoc_mock_imports.
Class _​Mock​Object Used by autodoc_mock_imports.
Class ​Mock​Finder A finder for mocking.
Class ​Mock​Loader A loader for mocking.
Function ​_make​_subclass Undocumented
Function ismock Check if the object is mocked.
Function mock Insert mock modules during context:
Function undecorate Unwrap mock if subject is decorated by mocked object.
logger =

Undocumented

def _make_subclass(name, module, superclass=_MockObject, attributes=None, decorator_args=()):

Undocumented

Parameters
name:strUndocumented
module:strUndocumented
superclass:AnyUndocumented
attributes:AnyUndocumented
decorator​_args:TupleUndocumented
Returns
AnyUndocumented
def ismock(subject):
Check if the object is mocked.
Parameters
subject:AnyUndocumented
Returns
boolUndocumented
@contextlib.contextmanager
def mock(modnames):

Insert mock modules during context:

with mock(['target.module.name']):
# mock modules are enabled here ...
Parameters
modnames:List[str]Undocumented
Returns
Generator[None, None, None]Undocumented
def undecorate(subject):

Unwrap mock if subject is decorated by mocked object.

If not decorated, returns given subject itself.

Parameters
subject:_MockObjectUndocumented
Returns
AnyUndocumented