diff --git a/tests/iotools/test_meteonorm.py b/tests/iotools/test_meteonorm.py index 3dac14928c..2eeb93431f 100644 --- a/tests/iotools/test_meteonorm.py +++ b/tests/iotools/test_meteonorm.py @@ -124,7 +124,10 @@ def test_get_meteonorm_training( assert meta == expected_meta pd.testing.assert_index_equal(data.index, expected_meteonorm_index) - pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_data) + # meteonorm API only guarantees similar, not identical, results between + # calls. so we allow a small amount of variation with atol. + pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_data, + check_exact=False, atol=1) @pytest.mark.remote_data @@ -304,4 +307,7 @@ def test_get_meteonorm_tmy( map_variables=False, url=demo_url) assert meta == expected_meteonorm_tmy_meta - pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_tmy_data) + # meteonorm API only guarantees similar, not identical, results between + # calls. so we allow a small amount of variation with atol. + pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_tmy_data, + check_exact=False, atol=1) diff --git a/tests/iotools/test_sodapro.py b/tests/iotools/test_sodapro.py index 09f5ee38ea..044ca97aa6 100644 --- a/tests/iotools/test_sodapro.py +++ b/tests/iotools/test_sodapro.py @@ -21,7 +21,8 @@ index_verbose = pd.date_range('2020-06-01 12', periods=4, freq='1min', tz='UTC') -index_monthly = pd.date_range('2020-01-01', periods=4, freq='1ME') +index_monthly = pd.to_datetime(['2020-01-31', '2020-02-29', '2020-03-31', + '2020-04-30']) dtypes_mcclear_verbose = [ diff --git a/tests/iotools/test_solargis.py b/tests/iotools/test_solargis.py index f7aedd58f0..eced226595 100644 --- a/tests/iotools/test_solargis.py +++ b/tests/iotools/test_solargis.py @@ -65,7 +65,8 @@ def test_get_solargis_utc_start_timestamp(hourly_index_start_utc): @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) def test_get_solargis_http_error(): # Test if HTTPError is raised if date outside range is specified - with pytest.raises(requests.HTTPError, match="data coverage"): + match = r"request fromDate .* is before the available start date" + with pytest.raises(requests.HTTPError, match=match): _, _ = pvlib.iotools.get_solargis( latitude=48.61259, longitude=20.827079, start='1920-01-01', end='1920-01-01', # date outside range