Skip to content

Commit

Permalink
Merge branch 'main' into bugfix-generic_image-float64
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Oct 14, 2024
2 parents c6db95d + 2d7f5ed commit b8991c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 1 addition & 5 deletions satpy/readers/insat3d_img_l1b_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import dask.array as da
import numpy as np
import xarray as xr

from satpy.utils import import_error_helper

with import_error_helper("xarray-datatree"):
from datatree import DataTree
from xarray.core.datatree import DataTree

from satpy.readers.file_handlers import BaseFileHandler

Expand Down
12 changes: 7 additions & 5 deletions satpy/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,15 @@ def test_basic_check_satpy(self):
from satpy.utils import check_satpy
check_satpy()

def test_specific_check_satpy(self):
def test_specific_check_satpy(self, capsys):
"""Test 'check_satpy' with specific features provided."""
from satpy.utils import check_satpy
with mock.patch("satpy.utils.print") as print_mock:
check_satpy(readers=["viirs_sdr"], packages=("cartopy", "__fake"))
checked_fake = any("__fake: not installed" in c[1] for c in print_mock.mock_calls if len(c[1]))
assert checked_fake, "Did not find __fake package mentioned in checks"
check_satpy(readers=["viirs_sdr"], packages=("cartopy", "__fake"))
out, _ = capsys.readouterr()
checked_fake = "__fake: not installed" in out
checked_viirs_sdr = "Readers\n=======\nviirs_sdr" in out
assert checked_fake, "Did not find __fake package mentioned in checks"
assert checked_viirs_sdr, "Did not find viirs_sdr in readers mentioned in checks"


class TestShowVersions:
Expand Down

0 comments on commit b8991c0

Please sign in to comment.