Skip to content

Commit

Permalink
FIX: Check UserWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Feb 23, 2024
1 parent 7730cdb commit f4e101c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/io/test_odim.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
ported from wradlib
"""
from contextlib import nullcontext

import numpy as np
import pytest
Expand Down Expand Up @@ -108,7 +109,14 @@ def test_get_time_what(a1gate, enddate):
else:
a1g = 946684800.0
where = dict(nrays=360, a1gate=a1gate[0])
time = odim._get_time_what(what, where)
if not enddate:
check = pytest.warns(
UserWarning, match="Equal ODIM `starttime` and `endtime` values"
)
else:
check = nullcontext()
with check:
time = odim._get_time_what(what, where)
assert time[0] == a1g
assert len(time) == 360

Expand Down

0 comments on commit f4e101c

Please sign in to comment.