Skip to content

adapt tests to new implementation #100

adapt tests to new implementation

adapt tests to new implementation #100

GitHub Actions / Unit Test Results Python 3.11 failed Nov 8, 2023 in 0s

2 fail, 645 pass in 6m 43s

647 tests   - 2   645 ✔️ +1   6m 43s ⏱️ -5s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       2  - 3 

Results for commit 8200a54. ± Comparison against earlier commit 8726b2a.

Annotations

Check warning on line 0 in climada.hazard.test.test_tc_cc.TestKnutson

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results Python 3.11

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

See this annotation in the file changed.

@github-actions github-actions / Unit Test Results Python 3.11

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