Black #1151
GitHub Actions / Core / Unit Test Results (3.9)
failed
Jan 13, 2025 in 0s
2 fail, 708 pass in 10m 35s
Annotations
Check warning on line 0 in climada.util.test.test_finance.TestWBData
github-actions / Core / Unit Test Results (3.9)
test_gdp_sxm_2010_pass (climada.util.test.test_finance.TestWBData) failed
tests_xml/tests.xml [took 0s]
Raw output
AssertionError: 'GDP SXM 2011: 9.361e+08' not found in 'INFO:climada.util.finance:GDP SXM 2010: 8.923e+08.'
self = <climada.util.test.test_finance.TestWBData testMethod=test_gdp_sxm_2010_pass>
def test_gdp_sxm_2010_pass(self):
"""Test gdp function Sint Maarten."""
# If World Bank input data changes, make sure to set ref_year to a year where
# no data is available so that the next available data point has to be selected.
ref_year = 2010
with self.assertLogs("climada.util.finance", level="INFO") as cm:
gdp_year, gdp_val = gdp("SXM", ref_year)
ref_val = 936089385.47486 # reference GDP value
ref_year = 2011 # nearest year with data available (might change)
# GDP and years with data available might change if worldbank input
# data changes, check magnitude and adjust ref_val and/or ref_year
# if test fails:
> self.assertIn("GDP SXM %i: %1.3e" % (ref_year, ref_val), cm.output[0])
E AssertionError: 'GDP SXM 2011: 9.361e+08' not found in 'INFO:climada.util.finance:GDP SXM 2010: 8.923e+08.'
climada/util/test/test_finance.py:115: AssertionError
Check warning on line 0 in climada.util.test.test_finance.TestWBData
github-actions / Core / Unit Test Results (3.9)
test_wb_esp_1950_pass (climada.util.test.test_finance.TestWBData) failed
tests_xml/tests.xml [took 0s]
Raw output
AssertionError: 12424514013.7604 != 12433394725.2159 within 7 places (8880711.455499649 difference)
self = <climada.util.test.test_finance.TestWBData testMethod=test_wb_esp_1950_pass>
def test_wb_esp_1950_pass(self):
"""Test world_bank function Sint Maarten."""
ref_year = 1950
wb_year, wb_val = world_bank("ESP", ref_year, "NY.GDP.MKTP.CD")
ref_year = 1960
ref_val = 12433394725.2159
self.assertEqual(wb_year, ref_year)
> self.assertAlmostEqual(wb_val, ref_val)
E AssertionError: 12424514013.7604 != 12433394725.2159 within 7 places (8880711.455499649 difference)
climada/util/test/test_finance.py:138: AssertionError
Loading