-
Notifications
You must be signed in to change notification settings - Fork 39
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 custom pytest marker: skip extract location tests in case of RequestTimeoutError from geolocator Nominatim #2002
Conversation
this Geocoder thing is either very busy or very fragile, or both, the test now reveals a possible GeocoderRateLimited error as well, which I am not catching in the custom marker 🤦♂️ |
Codecov Report
@@ Coverage Diff @@
## main #2002 +/- ##
==========================================
- Coverage 92.79% 92.71% -0.09%
==========================================
Files 236 236
Lines 12438 12438
==========================================
- Hits 11542 11532 -10
- Misses 896 906 +10 see 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@ESMValGroup/technical-lead-development-team I reckon we should get this in sooner than later since these HTTP request fails are multiplying now at every step of our testing sessions - it's getting a bit ridiculous if you asked me, I'll go straight and open an issue at Geopy |
The people running the geolocation service seem to not want people to run unit tests against it. Therefore, the solution that honours their usage policy would be to use a mock, instead of keep using the service in CI but skipping the test if it fails. |
Ah, I just saw you reached the same conclusion in the issue and @schlunma implemented a mock in #2005, which has now been merged. Can this be closed then @valeriupredoi? |
cheers @bouweandela - indeed this is ready to be closed, being superseded by #2005 that is the right way to go, but this may be quirky enough if we ever decide to add custom pytest markers (that I didn't know how to do, until I got to work on this), so I am going to change its name so at least I can find it in the future 👍 |
Description
I have actually tested this by force-failing geolocator from within itself (nifty way they coded up their exceptions raisers), and there are 8 tests that get skippity-skipped, if a
GeocoderUnavailable
exception is raised (no matter what message - who cares).A few notes about this implementation:
My take would be to get rid of this piece of unstable c**p
Closes #1982
Before you get started
Checklist
It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.
To help with the number pull requests: