adapt tests to new implementation #100
GitHub Actions / Unit Test Results Python 3.10
failed
Nov 8, 2023 in 0s
2 fail, 645 pass in 8m 13s
Annotations
Check warning on line 0 in climada.hazard.test.test_tc_cc.TestKnutson
github-actions / Unit Test Results Python 3.10
test_get_gmst_pass (climada.hazard.test.test_tc_cc.TestKnutson) failed
tests_xml/tests.xml [took 0s]
Raw output
AttributeError: 'str' object has no attribute 'shape'
self = <climada.hazard.test.test_tc_cc.TestKnutson testMethod=test_get_gmst_pass>
def test_get_gmst_pass(self):
"""Test get_gmst_info function."""
gmst_data, gmst_start_year, gmst_end_year, rcps = tc_cc.get_gmst_info()
> self.assertAlmostEqual(gmst_data.shape,
(len(rcps),
gmst_end_year-gmst_start_year+1))
E AttributeError: 'str' object has no attribute 'shape'
climada/hazard/test/test_tc_cc.py:48: AttributeError
Check warning on line 0 in climada.hazard.test.test_tc_cc.TestKnutson
github-actions / Unit Test Results Python 3.10
test_get_knutson_scaling_pass (climada.hazard.test.test_tc_cc.TestKnutson) failed
tests_xml/tests.xml [took 0s]
Raw output
AssertionError: -4.18586130859612 != -16.13547 within 4 places (11.949608691403881 difference)
self = <climada.hazard.test.test_tc_cc.TestKnutson testMethod=test_get_knutson_scaling_pass>
def test_get_knutson_scaling_pass(self):
"""Test get_knutson_criterion function."""
criterion = tc_cc.get_knutson_scaling_factor()
self.assertEqual(criterion.shape, (21, 4))
self.assertEqual(criterion.columns[0], '2.6')
self.assertEqual(criterion.columns[1], '4.5')
self.assertEqual(criterion.columns[2], '6.0')
self.assertEqual(criterion.columns[3], '8.5')
> self.assertAlmostEqual(criterion.loc[2030, '2.6'], -16.13547, 4)
E AssertionError: -4.18586130859612 != -16.13547 within 4 places (11.949608691403881 difference)
climada/hazard/test/test_tc_cc.py:39: AssertionError
Loading