-
Notifications
You must be signed in to change notification settings - Fork 15
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
Mock the Census API for tests so that Actions doesn't actually hit the API when running tests #864
Conversation
Codecov Report
@@ Coverage Diff @@
## main #864 +/- ##
==========================================
- Coverage 96.40% 96.37% -0.04%
==========================================
Files 46 46
Lines 2645 2645
==========================================
- Hits 2550 2549 -1
- Misses 95 96 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sooo much cleaner! 🚀
@emmastephenson rightly pointed out that there are also geocoding functions running in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work @robertmitchellv. I'm going to have to read the docs on @pytest.fixture
and use it the next time I'm writing unit tests. 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for figuring out that other test!
PULL REQUEST
Summary
Mock the Census API for tests so that Actions doesn't actually hit the API when running tests. If there is any kind of rate limiting or issue with the external API we don't want that to halt our ability to merge PRs.
Related Issue
Fixes #861
Additional Information
This is important so that when other tickets are completed and you want to merge to main you are not stopped because a unit test for code you're not working on is failing because it's actually hitting an external API and erroring out.