Skip to content

Commit

Permalink
allow for fixture creation to be skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Feb 13, 2024
1 parent 877a027 commit 7901ca9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ def remove_data_folder():
request.addfinalizer(remove_data_folder)


@pytest.mark.requires_netcdf
@pytest.fixture(scope="session")
def samplecat():
def samplecat(request):
"""Generate a sample catalog with the tutorial netCDFs."""
mark_skip = request.config.getoption("-m")
if "not requires_netcdf" == mark_skip:
pytest.skip("Skipping tests that require netCDF files")

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

0 comments on commit 7901ca9

Please sign in to comment.