Skip to content

Commit

Permalink
add another test for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kandersolar committed Feb 9, 2024
1 parent 39a658b commit 71aff10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pvlib/tests/iotools/test_solrad.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,15 @@ def test_get_solrad(testfile, station):
actual = df.reindex(expected.index)
# ABQ test file has an unexplained NaN in row 4; just verify first 3 rows
assert_frame_equal(actual.iloc[:3], expected.iloc[:3])


@pytest.mark.remote_data
def test_get_solrad_missing_day():
# data availability begins for ABQ on 2002-02-01 (DOY 32), so requesting
# data before that will raise a warning
message = 'The following file was not found: abq/2002/abq02031.dat'
with pytest.warns(UserWarning, match=message):
df, meta = solrad.get_solrad('abq', '2002-01-31', '2002-02-01')

# but the data for 2022-02-01 is still returned
assert not df.empty

0 comments on commit 71aff10

Please sign in to comment.