uber / doubles

Test doubles for Python.
MIT License
164 stars 17 forks source link

Clarify difference between allow and expect #57

Closed charlax closed 10 years ago

charlax commented 10 years ago

There's an opportunity for misunderstanding how allow and expect work. In particular, when using expect with and_return, you'll get the following exception:

UnsupportedMethodError: `expect` does not support and_return. Use `allow` and assert that an exception is raised instead.

Yet, if you replace directly with allow, you'll get the same behavior (except that the fact that it's called is not asserted, only that if it is called it's called how it's allowed to be called). So the part about Use allow and assert that an exception is raised instead. is confusing.

Thoughts?

toddsifleet commented 10 years ago

I agree this is confusing, I think it was a copy paste mistake, the same message is used in 3 places.

I will update the copy.