-
Notifications
You must be signed in to change notification settings - Fork 58
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
Feature/use gb full #18
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for your PR @amarchin ! A few comments are below.
Also I need to fix CI which is failing for an unrelated issues, will do that in a separate PR..
Please sync with master, the CI should now be fixed and the failing IE test marked as a known failure. |
Thank you for your review! I tried to address your comments. Let me know what you think :) |
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.
Thanks! A few last comments otherwise LGTM.
self._data_path, self._data = self._get_data(country) | ||
country_obj = _Country(country) | ||
self.country = country_obj.name | ||
self.download_path = country_obj.get_download_path() |
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.
Let's make this private as well,
self.download_path = country_obj.get_download_path() | |
self._download_path = country_obj.get_download_path() |
@@ -26,6 +26,11 @@ def temp_dir(): | |||
shutil.rmtree(path) | |||
|
|||
|
|||
@pytest.fixture(scope='session') | |||
def country_gb_full(): | |||
return pgeocode._Country('gb_full') |
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.
Typically session level fixtures are used for expensive operation (e.g. loading the data, or file access operations) once per session run.
To test _Country
we should rather initialize it in each test that needs (and not use fixture).
|
||
|
||
def test_that_get_clean_country_raises_value_error(): | ||
with pytest.raises(ValueError): |
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.
with pytest.raises(ValueError): | |
with pytest.raises(ValueError, match="not a known country code"): |
Hi guys! Is it possible to merge this fix? It would still be great to have the possibility to use GB_full database instead GB |
Countries
.