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 usage of any subject attribute renderer messages #62

Closed
wants to merge 1 commit into from

Conversation

sgissinger
Copy link
Contributor

I propose this because I'm doing custom operator to wrap unit test mocks assertions.

And I wanted to display the number of call count which is an attribute of MagicMock object.

    expected_message = Operator.Dsl.Message(
        'a mock that has been called {value} times',
        'a mock that has not been called {value} times',
    )
    subject_message = Operator.Dsl.Message(
        'a mock that has been called {%call_count%} times',
        'a mock that has not been called {%call_count%} times',
    )

When {value} is used in subject_message it prints the repr() value

<MagicMock name='get_service_state.name' id='1897037976184'>

@sgissinger
Copy link
Contributor Author

Used another way in #64

@sgissinger sgissinger closed this Nov 17, 2020
@sgissinger sgissinger deleted the patch-3 branch November 17, 2020 13:50
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.

None yet

1 participant