From 3929d970442a732c0dbd372e0d164db9f25cc097 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.dos.anjos@gmail.com> Date: Sun, 2 Jun 2024 22:25:21 +0200 Subject: [PATCH] [tests] Mark slow tests (closes #73) --- pyproject.toml | 6 +++++- tests/test_cli.py | 5 +++++ tests/test_montgomery.py | 1 + tests/test_montgomery_shenzhen.py | 1 + tests/test_montgomery_shenzhen_indian.py | 1 + tests/test_montgomery_shenzhen_indian_padchest.py | 1 + tests/test_montgomery_shenzhen_indian_tbx11k.py | 1 + 7 files changed, 15 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6ffc4ab8..37c132aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -165,7 +165,10 @@ uv = "*" uv-update-lock = "uv pip compile -q pyproject.toml --python-platform=linux -o uv.lock" [tool.pixi.feature.cuda] -channels = [{ channel = "nvidia", priority = 1}, { channel = "pytorch", priority = -1 }] +channels = [ + { channel = "nvidia", priority = 1 }, + { channel = "pytorch", priority = -1 }, +] platforms = ["linux-64", "osx-arm64"] [tool.pixi.feature.cuda.system-requirements] @@ -483,3 +486,4 @@ override_SS05 = [ # override SS05 to allow docstrings starting with these words addopts = ["--cov=mednet", "--cov-report=term-missing", "--import-mode=append"] junit_logging = "all" junit_log_passing_tests = false +markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"] diff --git a/tests/test_cli.py b/tests/test_cli.py index d98ef50f..e79d500d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -201,6 +201,7 @@ def test_upload_help(): _check_help(upload) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") def test_train_pasa_montgomery(temporary_basedir): from mednet.scripts.train import train @@ -256,6 +257,7 @@ def test_train_pasa_montgomery(temporary_basedir): ) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") def test_train_pasa_montgomery_from_checkpoint(temporary_basedir): from mednet.scripts.train import train @@ -333,6 +335,7 @@ def test_train_pasa_montgomery_from_checkpoint(temporary_basedir): ) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") def test_predict_pasa_montgomery(temporary_basedir): from mednet.scripts.predict import predict @@ -386,6 +389,7 @@ def test_predict_pasa_montgomery(temporary_basedir): ) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") def test_evaluate_pasa_montgomery(temporary_basedir): from mednet.scripts.evaluate import evaluate @@ -432,6 +436,7 @@ def test_evaluate_pasa_montgomery(temporary_basedir): ) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") def test_experiment(temporary_basedir): from mednet.scripts.experiment import experiment diff --git a/tests/test_montgomery.py b/tests/test_montgomery.py index 3db2bad6..fddeaefa 100644 --- a/tests/test_montgomery.py +++ b/tests/test_montgomery.py @@ -110,6 +110,7 @@ def test_loading(database_checkers, name: str, dataset: str): limit -= 1 +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") def test_raw_transforms_image_quality(database_checkers, datadir: pathlib.Path): datamodule = importlib.import_module( diff --git a/tests/test_montgomery_shenzhen.py b/tests/test_montgomery_shenzhen.py index 58bc9806..58f3313c 100644 --- a/tests/test_montgomery_shenzhen.py +++ b/tests/test_montgomery_shenzhen.py @@ -61,6 +61,7 @@ def test_split_consistency(name: str): assert isinstance(combined.splits[split][1][1], shenzhen_loader) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") @pytest.mark.skip_if_rc_var_not_set("datadir.shenzhen") def test_database_check(): diff --git a/tests/test_montgomery_shenzhen_indian.py b/tests/test_montgomery_shenzhen_indian.py index 470ee2cf..47de3afd 100644 --- a/tests/test_montgomery_shenzhen_indian.py +++ b/tests/test_montgomery_shenzhen_indian.py @@ -75,6 +75,7 @@ def test_split_consistency(name: str): assert isinstance(combined.splits[split][2][1], indian_loader) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") @pytest.mark.skip_if_rc_var_not_set("datadir.indian") @pytest.mark.skip_if_rc_var_not_set("datadir.shenzhen") diff --git a/tests/test_montgomery_shenzhen_indian_padchest.py b/tests/test_montgomery_shenzhen_indian_padchest.py index d56798a7..e44b5b60 100644 --- a/tests/test_montgomery_shenzhen_indian_padchest.py +++ b/tests/test_montgomery_shenzhen_indian_padchest.py @@ -81,6 +81,7 @@ def test_split_consistency(name: str, padchest_name: str): assert isinstance(combined.splits[split][3][1], padchest_loader) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") @pytest.mark.skip_if_rc_var_not_set("datadir.shenzhen") @pytest.mark.skip_if_rc_var_not_set("datadir.indian") diff --git a/tests/test_montgomery_shenzhen_indian_tbx11k.py b/tests/test_montgomery_shenzhen_indian_tbx11k.py index 0a4a3bff..75464104 100644 --- a/tests/test_montgomery_shenzhen_indian_tbx11k.py +++ b/tests/test_montgomery_shenzhen_indian_tbx11k.py @@ -100,6 +100,7 @@ def test_split_consistency(name: str, tbx11k_name: str): assert isinstance(combined.splits[split][3][1], tbx11k_loader) +@pytest.mark.slow @pytest.mark.skip_if_rc_var_not_set("datadir.montgomery") @pytest.mark.skip_if_rc_var_not_set("datadir.shenzhen") @pytest.mark.skip_if_rc_var_not_set("datadir.indian") -- GitLab