You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation explains how to mock modules, functions, etc., but never explains how to mock classes and their related entities. There are many approaches out on the web; a developer has to wade through different approaches and test each of them to determine if they are correct or not.
Suggested solution
The documentation should have verified explanations and examples for mocking:
an entire class
an instance of a class
a single method from a class
other related entities that should also be included
This will likely mean some extended discussions in order to agree on correct approaches. (And perhaps only one of many valid approaches is shown, with pointers or a brief explanation for others.)
Discussion(s) could take place in.... the discussions .
I'm proposing that the documentation be updated to include examples of how to mock not just an instance of a class, but a single method, or a static method, or all instances of a class, etc., to cover all of the OO/class things can be mocked.
(And sorry for the delay in responding. I appreciate that you responded quickly. :-) )
Clear and concise description of the problem
The documentation explains how to mock modules, functions, etc., but never explains how to mock classes and their related entities. There are many approaches out on the web; a developer has to wade through different approaches and test each of them to determine if they are correct or not.
Suggested solution
The documentation should have verified explanations and examples for mocking:
This will likely mean some extended discussions in order to agree on correct approaches. (And perhaps only one of many valid approaches is shown, with pointers or a brief explanation for others.)
Discussion(s) could take place in.... the discussions .
Related: #4001 Utility to auto mock class instance
I'm quite interested in this and
canwill kick-off a discussion.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: