specused as a template for your mock object. According to the documentation :
If you use the spec or spec_set arguments, then only the magic methods that exist in the specification will be created.
, -, , . :
. spec , , spec, AttributeError.
autospec patch spec MagicMock. :
autospec = True, spec .