Skip to content

Commit

Permalink
safer checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 13, 2024
1 parent 7901ca9 commit a871630
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def remove_data_folder():
def samplecat(request):
"""Generate a sample catalog with the tutorial netCDFs."""
mark_skip = request.config.getoption("-m")
if "not requires_netcdf" == mark_skip:
if "not requires_netcdf" == mark_skip or not SAMPLES_DIR.exists():
pytest.skip("Skipping tests that require netCDF files")
elif list(SAMPLES_DIR.rglob("*.nc")) is []:
pytest.skip("No netCDF files found in the tutorial samples folder")

df = xs.parse_directory(
directories=[SAMPLES_DIR],
Expand Down

0 comments on commit a871630

Please sign in to comment.