diff --git a/pyproject.toml b/pyproject.toml index e454cc9..e280201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,3 +62,8 @@ dev = [ ] [project.scripts] mllam_data_prep = "mllam_data_prep:cli.call" + +[tool.pytest.ini_options] +markers = [ + "slow: marks tests requiring network access or AWS credentials (deselect with '-m \"not slow\"')", +] diff --git a/tests/test_cli.py b/tests/test_cli.py index 064bbba..bd4a47f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,3 +1,4 @@ +import subprocess import tempfile import pytest @@ -6,9 +7,20 @@ from mllam_data_prep.cli import call +@pytest.mark.slow @pytest.mark.parametrize("args", [["example.danra.yaml"]]) def test_call(args): with tempfile.TemporaryDirectory(suffix=".zarr") as tmpdir: args.extend(["--output", tmpdir]) call(args) _ = xr.open_zarr(tmpdir) + + +def test_cli_entrypoint_help(): + """Test the actual installed CLI entry point works as a subprocess.""" + result = subprocess.run( + ["mllam_data_prep", "--help"], + capture_output=True, text=True + ) + assert result.returncode == 0 + assert "config" in result.stdout.lower()