(
cls, spec=None, wraps=None, name=None, spec_set=None,
parent=None, _spec_state=None, _new_name='', _new_parent=None,
_spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
)
| 443 | _lock = RLock() |
| 444 | |
| 445 | def __new__( |
| 446 | cls, spec=None, wraps=None, name=None, spec_set=None, |
| 447 | parent=None, _spec_state=None, _new_name='', _new_parent=None, |
| 448 | _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs |
| 449 | ): |
| 450 | # every instance has its own class |
| 451 | # so we can create magic methods on the |
| 452 | # class without stomping on other mocks |
| 453 | bases = (cls,) |
| 454 | if not issubclass(cls, AsyncMockMixin): |
| 455 | # Check if spec is an async object or function |
| 456 | spec_arg = spec_set or spec |
| 457 | if spec_arg is not None and _is_async_obj(spec_arg): |
| 458 | bases = (AsyncMockMixin, cls) |
| 459 | new = type(cls.__name__, bases, {'__doc__': cls.__doc__}) |
| 460 | instance = _safe_super(NonCallableMock, cls).__new__(new) |
| 461 | return instance |
| 462 | |
| 463 | |
| 464 | def __init__( |
nothing calls this directly
no test coverage detected