Skip to content

Commit b309dca

Browse files
committed
Add test
1 parent c66c72b commit b309dca

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

pvlib/iotools/meteonorm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from urllib.parse import urljoin
66
from pandas._libs.tslibs.parsing import DateParseError
77

8+
from pvlib._deprecation import warn_deprecated
9+
810
URL = "https://api.meteonorm.com/v1/"
911

1012
VARIABLE_MAP = {

tests/iotools/test_meteonorm.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from tests.conftest import RERUNS, RERUNS_DELAY
66
from requests.exceptions import HTTPError
77

8+
from pvlib._deprecation import pvlibDeprecationWarning
9+
810

911
@pytest.fixture
1012
def demo_api_key():
@@ -314,3 +316,14 @@ def test_get_meteonorm_tmy(
314316
# calls. so we allow a small amount of variation with atol.
315317
pd.testing.assert_frame_equal(data.iloc[:12], expected_meteonorm_tmy_data,
316318
check_exact=False, atol=1)
319+
320+
321+
@fail_on_pvlib_version('0.17.0')
322+
def test_get_meteonorm_tmy_data_version_deprecation(demo_api_key):
323+
with pytest.warns(pvlibDeprecationWarning):
324+
_ = pvlib.iotools.get_meteonorm_tmy(
325+
latitude,
326+
longitude,
327+
api_key=demo_api_key,
328+
data_version="latest",
329+
)

0 commit comments

Comments
 (0)