Skip to content

Commit

Permalink
Add minimal test_netcdf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Jul 19, 2023
1 parent e3ceb31 commit 476cd5e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ jobs:
run: |
python -m pip install --no-deps -e .
- name: Run unit tests - enhancement_tests - enhancements - nwcsaf
- name: Run unit tests - test_netcdf
shell: bash -l {0}
run: |
pytest satpy/tests/enhancement_tests/test_enhancements.py::test_nwcsaf_comps
pytest test_netcdf.py
# - name: Run unit tests - enhancement_tests - enhancements - nwcsaf
# shell: bash -l {0}
# run: |
# pytest satpy/tests/enhancement_tests/test_enhancements.py::test_nwcsaf_comps
- name: Run unit tests - scene_tests
shell: bash -l {0}
run: |
Expand Down
16 changes: 16 additions & 0 deletions test_netcdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import xarray as xr


def test_netcdf(tmp_path):
fn = "test.nc"
fk = tmp_path / fn
# create a minimally fake netCDF file, otherwise satpy won't load the composite
ds = xr.Dataset(
coords={"nx": [0], "ny": [0]},
attrs={
"source": "satpy unit test",
"time_coverage_start": "0001-01-01T00:00:00Z",
"time_coverage_end": "0001-01-01T01:00:00Z",
}
)
ds.to_netcdf(fk)

0 comments on commit 476cd5e

Please sign in to comment.