Closed GoogleCodeExporter closed 9 years ago
I agree that it should be possible to *set* __name__. What should it be by
default though? (Note that most objects don't have a __name__ - classes do
though.)
Original comment by fuzzyman
on 10 Feb 2011 at 11:23
You're absolutely right in that most objects don't have a __name__, but for the
most parts, functions and classes do have the __name__ attribute which I would
assume would be the main use case for Mock.
Now that I think about it, maybe default __name__ might not be a good idea, but
at least the ability to support it would make sense. However, if we were to
decide to allow a default name, then I would assume something similar to
MockObject or maybe even whatever the __repr__ might be.
Thoughts?
Original comment by mabdelka...@gmail.com
on 21 Feb 2011 at 7:33
Well, in terms of "supporting it", you can already set __name__ to a string on
a mock (I thought it might not be possible but it is). Beyond that I'm not sure
what we could do to support it.
Original comment by fuzzyman
on 22 Feb 2011 at 8:26
Note that mock instances are just as commonly used to mock instances and so
shouldn't have a __name__ by default. Setting it if you need it works.
Any concrete proposals as to *changes* in Mock you can suggest?
If not I'll close this issue.
Original comment by fuzzyman
on 6 May 2011 at 11:59
Original comment by fuzzyman
on 14 May 2011 at 11:48
Original issue reported on code.google.com by
mabdelka...@gmail.com
on 10 Feb 2011 at 5:33