Skip to content
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

Merged
merged 2 commits into from
May 25, 2016

Conversation

jurko-gospodnetic
Copy link
Contributor

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.

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.
def test_failure_message_with_no_name(self, mocker):
self.__test_failure_message(mocker)

@pytest.mark.parametrize('name', (None, '', 'f', 'The Castle of aaarrrrggh'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice reference 😉

@nicoddemus
Copy link
Member

Cool, thanks for the contribution! Would you mind write a changelog entry as well?

@jurko-gospodnetic
Copy link
Contributor Author

jurko-gospodnetic commented May 16, 2016

Where to write it? Here in a comment? Or directly to CHANGELOG.rst?

If written to CHANGELOG.rst - under which version to put it - 0.11.1? or 0.12?

I added an entry to CHANGELOG.rst under 0.11.1 for now, trying to keep to the same style as used for already existing entries there, so let me know if that suits you or you need it tweaked some more.

@nicoddemus
Copy link
Member

That would be 0.12 to follow semantic versioning, but I will change it myself after merging. Thanks!

@nicoddemus
Copy link
Member

Hey @jurko-gospodnetic,

Sorry, I somehow thought this was merged already so it didn't went into the 1.0 release.

Well no matter, in a week or so I will release 1.1 and will make sure to include this. 😁

@jurko-gospodnetic
Copy link
Contributor Author

no problem :-) Mentally I already count it as merged, i.e. water under the bridge... :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants