From 1376daa32d12108a6901fce8728e2dc638c1fa98 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 22 Feb 2026 02:37:34 +0530 Subject: [PATCH 1/2] add CLI entrypoint test to catch import/dependency errors --- tests/test_cli.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 064bbba..cd7189e 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -12,3 +12,14 @@ def test_call(args): 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.""" + import subprocess + result = subprocess.run( + ["mllam_data_prep", "--help"], + capture_output=True, text=True + ) + assert result.returncode == 0 + assert "config" in result.stdout.lower() From c9c4dd2e8a2c39860744d02ab24cd22b75b5d27d Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 22 Feb 2026 02:39:24 +0530 Subject: [PATCH 2/2] mark slow CLI test, register slow mark in pyproject.toml --- pyproject.toml | 5 +++++ tests/test_cli.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 cd7189e..bd4a47f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,3 +1,4 @@ +import subprocess import tempfile import pytest @@ -6,6 +7,7 @@ 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: @@ -16,7 +18,6 @@ def test_call(args): def test_cli_entrypoint_help(): """Test the actual installed CLI entry point works as a subprocess.""" - import subprocess result = subprocess.run( ["mllam_data_prep", "--help"], capture_output=True, text=True