[issue30548] typo in documentation for create_autospec

2019-10-30 Thread Erik Byström

Erik Byström  added the comment:

Yes, you're right. I do think the docs are a bit misleading.

Maybe something like this would make it more clear?

"If a class is used as a spec then the returned object will be a mock of that 
class. When the constructor of the returned mock class is invoked an instance 
object is returned that has the same spec as a normal instance object would 
have. By passing instance=True you can directly create a mock instance of the 
class."

If not, feel free to close this issue.

--

___
Python tracker 
<https://bugs.python.org/issue30548>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30548] typo in documentation for create_autospec

2017-06-02 Thread Erik Byström

New submission from Erik Byström:

"a class" should most probably be replaced by "an instance" in the 
documentation for create_autospec.

"You can use a class as the spec for an instance object by passing 
instance=True. The returned mock will only be callable if instances of the mock 
are callable."

https://docs.python.org/3/library/unittest.mock.html#unittest.mock.create_autospec

--
assignee: docs@python
components: Documentation
messages: 294993
nosy: Erik Byström, docs@python
priority: normal
severity: normal
status: open
title: typo in documentation for create_autospec
type: enhancement
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30548>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com