Skip to content

Commit

Permalink
Tests: Do not strongly depend on wradlib
Browse files Browse the repository at this point in the history
Instead, skip corresponding tests when not installed.
  • Loading branch information
amotl authored and gutzbenj committed Sep 26, 2022
1 parent e44e8d9 commit 4148b05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/provider/dwd/radar/test_api_historic.py
Expand Up @@ -10,7 +10,6 @@
import pybufrkit
import pytest
import requests
import wradlib as wrl

from wetterdienst.provider.dwd.radar import (
DwdRadarDataFormat,
Expand All @@ -23,6 +22,8 @@
from wetterdienst.provider.dwd.radar.sites import DwdRadarSite
from wetterdienst.util.datetime import round_minutes

wrl = pytest.importorskip("wradlib", reason="wradlib not installed")

HERE = Path(__file__).parent


Expand Down
5 changes: 4 additions & 1 deletion tests/provider/dwd/radar/test_api_latest.py
Expand Up @@ -5,7 +5,6 @@
from datetime import datetime

import pytest
import wradlib as wrl

from tests.provider.dwd.radar import station_reference_pattern_unsorted
from wetterdienst.provider.dwd.radar import DwdRadarValues
Expand Down Expand Up @@ -44,6 +43,8 @@ def test_radar_request_composite_latest_rw_reflectivity():
Example for testing radar COMPOSITES (RADOLAN) latest.
"""

wrl = pytest.importorskip("wradlib", reason="wradlib not installed")

request = DwdRadarValues(
parameter=DwdRadarParameter.RW_REFLECTIVITY,
start_date=DwdRadarDate.LATEST,
Expand Down Expand Up @@ -109,6 +110,8 @@ def test_radar_request_site_latest_dx_reflectivity():
Example for testing radar SITES latest.
"""

wrl = pytest.importorskip("wradlib", reason="wradlib not installed")

request = DwdRadarValues(
parameter=DwdRadarParameter.DX_REFLECTIVITY,
start_date=DwdRadarDate.LATEST,
Expand Down
3 changes: 2 additions & 1 deletion tests/provider/dwd/radar/test_api_most_recent.py
Expand Up @@ -2,7 +2,6 @@
# Copyright (C) 2018-2021, earthobservations developers.
# Distributed under the MIT License. See LICENSE for more info.
import pytest
import wradlib as wrl

from wetterdienst.provider.dwd.radar import (
DwdRadarParameter,
Expand Down Expand Up @@ -119,6 +118,8 @@ def test_radar_request_radolan_cdc_most_recent():
Example for testing radar sites most recent RADOLAN_CDC.
"""

wrl = pytest.importorskip("wradlib", reason="wradlib not installed")

request = DwdRadarValues(
parameter=DwdRadarParameter.RADOLAN_CDC,
resolution=DwdRadarResolution.DAILY,
Expand Down

0 comments on commit 4148b05

Please sign in to comment.