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

Unit test mock calls are not asserted #112

Open
marblestation opened this issue Oct 23, 2020 · 1 comment
Open

Unit test mock calls are not asserted #112

marblestation opened this issue Oct 23, 2020 · 1 comment

Comments

@marblestation
Copy link
Contributor

When mocking functions in unit tests, it would be good to check that they have been actually called. For instance, the following example could be asserted if it was called:

self.get_batch_mock = self.patcher.start()

This way we would avoid situation where some code change leads the mock to fail and we end up running the real code (e.g., executing real HTTP requests during unit testing).

@kelockhart
Copy link
Member

@marblestation I've hacked a fix to this in the meantime by editing the URLs in the tests to not be real URLs (I've mostly appended _test to the given URLs). I agree that a more robust solution would be good too, but right now we're not in danger of executing real requests.

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

No branches or pull requests

2 participants