@@ -272,18 +272,11 @@ def test_get_pvgis_hourly_bad_status_code(requests_mock):
272272
273273
274274def test_get_pvgis_hourly_bad_outputformat (requests_mock ):
275- # Test if a ValueError is raised if an unsupported outputformat is used
276- # error is raised by the PVGIS service, hence it is a HTTPError
277- requests_mock .get (url_bad_outputformat )
278- with pytest .raises (requests .HTTPError ):
279- get_pvgis_hourly (latitude = 45 , longitude = 8 , outputformat = 'error' )
280-
281-
282- def test_get_pvgis_tmy_basic_outputformat ():
283275 # Test if a ValueError is raised if an unsupported outputformat is used
284276 # E.g. 'basic' is a valid PVGIS format, but is not supported by pvlib
285- with pytest .raises (ValueError , match = "outputformat='basic' is no longer" ):
286- get_pvgis_tmy (latitude = 45 , longitude = 8 , outputformat = 'basic' )
277+ requests_mock .get (url_bad_outputformat )
278+ with pytest .raises (ValueError ):
279+ get_pvgis_hourly (latitude = 45 , longitude = 8 , outputformat = 'basic' )
287280
288281
289282url_additional_inputs = 'https://re.jrc.ec.europa.eu/api/seriescalc?lat=55.6814&lon=12.5758&outputformat=csv&angle=0&aspect=0&pvcalculation=1&pvtechchoice=crystSi&mountingplace=free&trackingtype=0&components=1&usehorizon=1&optimalangles=1&optimalinclination=0&loss=2&userhorizon=10%2C15%2C20%2C10&peakpower=5' # noqa: E501
@@ -542,6 +535,16 @@ def test_get_pvgis_tmy_error():
542535 get_pvgis_tmy (45 , 8 , url = 'https://re.jrc.ec.europa.eu/' )
543536
544537
538+ @pytest .mark .remote_data
539+ @pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
540+ def test_get_pvgis_tmy_basic (expected , meta_expected ):
541+ # Test that a specific error message is raised when outputformat='basic'
542+ err_msg = ("outputformat='basic' is no longer supported by pvlib, "
543+ "please use outputformat='csv' instead." )
544+ with pytest .raises (ValueError , match = err_msg ):
545+ get_pvgis_tmy (45 , 8 , outputformat = 'basic' )
546+
547+
545548@pytest .mark .remote_data
546549@pytest .mark .flaky (reruns = RERUNS , reruns_delay = RERUNS_DELAY )
547550def test_get_pvgis_map_variables (pvgis_tmy_mapped_columns ):
0 commit comments