77import pytest
88import requests
99from pvlib .iotools import get_pvgis_tmy , read_pvgis_tmy
10- from conftest import DATA_DIR
11-
10+ from conftest import DATA_DIR , RERUNS , RERUNS_DELAY
1211
1312@pytest .fixture
1413def expected ():
@@ -68,6 +67,7 @@ def csv_meta(meta_expected):
6867
6968
7069@pytest .mark .remote_data
70+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
7171def test_get_pvgis_tmy (expected , month_year_expected , inputs_expected ,
7272 meta_expected ):
7373 pvgis_data = get_pvgis_tmy (45 , 8 )
@@ -101,6 +101,7 @@ def _compare_pvgis_tmy_json(expected, month_year_expected, inputs_expected,
101101
102102
103103@pytest .mark .remote_data
104+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
104105def test_get_pvgis_tmy_kwargs (userhorizon_expected ):
105106 _ , _ , inputs , _ = get_pvgis_tmy (45 , 8 , usehorizon = False )
106107 assert inputs ['meteo_data' ]['use_horizon' ] is False
@@ -119,6 +120,7 @@ def test_get_pvgis_tmy_kwargs(userhorizon_expected):
119120
120121
121122@pytest .mark .remote_data
123+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
122124def test_get_pvgis_tmy_basic (expected , meta_expected ):
123125 pvgis_data = get_pvgis_tmy (45 , 8 , outputformat = 'basic' )
124126 _compare_pvgis_tmy_basic (expected , meta_expected , pvgis_data )
@@ -132,6 +134,7 @@ def _compare_pvgis_tmy_basic(expected, meta_expected, pvgis_data):
132134
133135
134136@pytest .mark .remote_data
137+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
135138def test_get_pvgis_tmy_csv (expected , month_year_expected , inputs_expected ,
136139 meta_expected , csv_meta ):
137140 pvgis_data = get_pvgis_tmy (45 , 8 , outputformat = 'csv' )
@@ -161,6 +164,7 @@ def _compare_pvgis_tmy_csv(expected, month_year_expected, inputs_expected,
161164
162165
163166@pytest .mark .remote_data
167+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
164168def test_get_pvgis_tmy_epw (expected , epw_meta ):
165169 pvgis_data = get_pvgis_tmy (45 , 8 , outputformat = 'epw' )
166170 _compare_pvgis_tmy_epw (expected , epw_meta , pvgis_data )
@@ -176,6 +180,7 @@ def _compare_pvgis_tmy_epw(expected, epw_meta, pvgis_data):
176180
177181
178182@pytest .mark .remote_data
183+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
179184def test_get_pvgis_tmy_error ():
180185 err_msg = 'outputformat: Incorrect value.'
181186 with pytest .raises (requests .HTTPError , match = err_msg ):
0 commit comments