Skip to content

Commit

Permalink
Suppress warnings when reading non-georeferenced data
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Apr 19, 2024
1 parent 097283f commit fe032c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions trollflow2/tests/test_trollflow2.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,14 +711,18 @@ def test_save_datasets_callback(tmp_path, caplog, fake_scene):

def testlog(obj, targs, job, fmat_config):
"""Toy function doing some logging."""
import warnings

filename = fmat_config["filename"]
# ensure computation has indeed completed and file was flushed
p = pathlib.Path(filename)
logger.info(f"Wrote {filename} successfully, {p.stat().st_size:d} bytes")
assert p.exists()
with rasterio.open(filename) as src:
arr = src.read(1)
assert arr[5, 5] == 142
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="Dataset has no geotransform")
with rasterio.open(filename) as src:
arr = src.read(1)
assert arr[5, 5] == 142
return obj

form = [
Expand Down

0 comments on commit fe032c3

Please sign in to comment.