diff --git a/climada/test/test_litpop_integr.py b/climada/test/test_litpop_integr.py index 2c2ddba88b..ae1b5588e9 100644 --- a/climada/test/test_litpop_integr.py +++ b/climada/test/test_litpop_integr.py @@ -53,7 +53,9 @@ def test_netherlands150_pass(self): self.assertEqual(ent.gdf.shape[0], 2829) def test_BLM150_pass(self): - """Test from_countries for BLM at 150 arcsec, 2 data points""" + """Test from_countries for BLM at 150 arcsec, 2 data points + The world bank doesn't provide data for Saint Barthélemy, fall back to natearth + """ ent = lp.LitPop.from_countries("BLM", res_arcsec=150, reference_year=2016) self.assertEqual(ent.gdf.shape[0], 2) diff --git a/climada/util/finance.py b/climada/util/finance.py index 262a2b4a09..7ae54fcc45 100644 --- a/climada/util/finance.py +++ b/climada/util/finance.py @@ -216,7 +216,7 @@ def download_world_bank_indicator( # Check if we received an error message try: if json_data[0]["message"][0]["id"] == "120": - raise RuntimeError( + raise ValueError( "Error requesting data from the World Bank API. Did you use the " "correct country code and indicator ID?" ) diff --git a/climada/util/test/test_finance.py b/climada/util/test/test_finance.py index 3791dfe79c..0676c7a095 100644 --- a/climada/util/test/test_finance.py +++ b/climada/util/test/test_finance.py @@ -151,12 +151,12 @@ def test_download_wb_data(self): # Check errors raised with self.assertRaisesRegex( - RuntimeError, + ValueError, "Did you use the correct country code", ): download_world_bank_indicator("Spain", "NY.GDP.MKTP.CD") with self.assertRaisesRegex( - RuntimeError, + ValueError, "Did you use the correct country code", ): download_world_bank_indicator("ESP", "BogusIndicator")