Skip to content

Commit 71aff10

Browse files
committed
add another test for coverage
1 parent 39a658b commit 71aff10

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pvlib/tests/iotools/test_solrad.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,15 @@ def test_get_solrad(testfile, station):
120120
actual = df.reindex(expected.index)
121121
# ABQ test file has an unexplained NaN in row 4; just verify first 3 rows
122122
assert_frame_equal(actual.iloc[:3], expected.iloc[:3])
123+
124+
125+
@pytest.mark.remote_data
126+
def test_get_solrad_missing_day():
127+
# data availability begins for ABQ on 2002-02-01 (DOY 32), so requesting
128+
# data before that will raise a warning
129+
message = 'The following file was not found: abq/2002/abq02031.dat'
130+
with pytest.warns(UserWarning, match=message):
131+
df, meta = solrad.get_solrad('abq', '2002-01-31', '2002-02-01')
132+
133+
# but the data for 2022-02-01 is still returned
134+
assert not df.empty

0 commit comments

Comments
 (0)