-
Notifications
You must be signed in to change notification settings - Fork 24
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
Write a recommendation for asserting multiple things on a signal #325
Comments
Allowing access to the mock seems like a good idea to me. |
Two opposing suggestions:
I think I prefer 1., but I would love it if there was a way to catch the typo issue... |
Yh, 2 is a slippery slope. I'm happy to go 1. I think you can avoid the typo problem by using class MyClass():
def blah(self):
...
Mock(spec=MyClass) # This can only be called with blah() or the methods inherent to Mock I'm happy to look at this as part of this issue? |
Yes please! |
DominicOram
added a commit
that referenced
this issue
May 23, 2024
DominicOram
added a commit
that referenced
this issue
May 23, 2024
DominicOram
added a commit
that referenced
this issue
May 23, 2024
DominicOram
added a commit
that referenced
this issue
May 23, 2024
Merged
DominicOram
added a commit
that referenced
this issue
May 24, 2024
DominicOram
added a commit
that referenced
this issue
May 24, 2024
DominicOram
added a commit
that referenced
this issue
May 24, 2024
DominicOram
added a commit
that referenced
this issue
May 24, 2024
abbiemery
pushed a commit
that referenced
this issue
May 28, 2024
abbiemery
pushed a commit
that referenced
this issue
May 28, 2024
abbiemery
pushed a commit
that referenced
this issue
May 28, 2024
abbiemery
pushed a commit
that referenced
this issue
May 28, 2024
abbiemery
pushed a commit
that referenced
this issue
May 28, 2024
abbiemery
pushed a commit
that referenced
this issue
May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a developer I may want to check multiple things on a mocked signal. Currently we have
assert_mock_put_called_with
but what if I want to assert many calls on the mock? We can currently do this with something like:This is fine except:
Some other ways we could do it are:
def assert_mock_has_calls(signal: Signal, calls)
- I'm not a big fan of this as it seems a slippery slope to re-implementingmock
Acceptance Criteria
The text was updated successfully, but these errors were encountered: