-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow passing mock name to mocker.stub() #40
allow passing mock name to mocker.stub() #40
Conversation
This allows customizing the stub's name displayed in any assertion failure messages (useful for debugging), without having to resort to setting `Mock` object's internal `_mock_name` attribute directly.
43d5246
to
449e1b2
Compare
def test_failure_message_with_no_name(self, mocker): | ||
self.__test_failure_message(mocker) | ||
|
||
@pytest.mark.parametrize('name', (None, '', 'f', 'The Castle of aaarrrrggh')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice reference 😉
Cool, thanks for the contribution! Would you mind write a changelog entry as well? |
Where to write it? Here in a comment? Or directly to If written to I added an entry to |
470953a
to
db3d262
Compare
That would be |
Hey @jurko-gospodnetic, Sorry, I somehow thought this was merged already so it didn't went into the Well no matter, in a week or so I will release |
no problem :-) Mentally I already count it as merged, i.e. water under the bridge... :-D |
This allows customizing the stub's name displayed in any assertion failure messages (useful for debugging), without having to resort to setting
Mock
object's internal_mock_name
attribute directly.