Skip to content

Commit

Permalink
Fallback in test if raven_hydro is not installed (#372)
Browse files Browse the repository at this point in the history
Fixes #371 

TODO: review dependencies to make raven_hydro a "soft" dependency ?
  • Loading branch information
Zeitsperre authored Jun 20, 2024
2 parents 47dd787 + 838dff0 commit 8b47515
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/test_emulators.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import datetime as dt
import warnings

import numpy as np
import pytest
import xarray as xr
from packaging.version import Version
from raven_hydro import __raven_version__

try:
from raven_hydro import __raven_version__
except ImportError:
warnings.warn(
UserWarning,
"The `raven-hydro` library is not installed. Setting '__raven_version__' to '0'.",
)
__raven_version__ = "0"

from ravenpy import Emulator
from ravenpy.config import commands as rc
Expand Down

0 comments on commit 8b47515

Please sign in to comment.