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

Add strict mode to Mocker #245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

phy1729
Copy link

@phy1729 phy1729 commented Jan 6, 2024

It would be nice to be able to assert that all mocks are used to catch bugs where a code path was inadvertently disabled. This PR adds a strict mode to Mocker so tests that fail to use all responses of all _Matchers will raise an AssertionError.

I tried to follow style and add relevant tests and stubs, but let me know if I missed anything.

@jamielennox
Copy link
Owner

Exhausted is simply another way of doing count > 0. Initially there had been the intent to provide this kind of helper function, but all the projects i've worked on have ended up writing them their own way as a method instead of on the mocker.

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