From 5096129c1c74bd4c12f0ede08f7f71aac2a7dd1b Mon Sep 17 00:00:00 2001 From: Daniel <63580393+danrgll@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:36:08 +0100 Subject: [PATCH] clean up tests --- .github/workflows/tests.yaml | 2 +- pyproject.toml | 5 ++--- tests/test_yaml_search_space/test_search_space.py | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0211dfbc..157c4afd 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -41,4 +41,4 @@ jobs: - name: Run pytest timeout-minutes: 15 - run: poetry run pytest -m "all_examples or metahyper or summary_csv" + run: poetry run pytest -m "all_examples or metahyper or summary_csv or yaml_api" diff --git a/pyproject.toml b/pyproject.toml index 4ab5188e..b552d705 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -102,9 +102,8 @@ profile = 'black' line_length = 90 [tool.pytest.ini_options] -addopts = "--basetemp ./tests_tmpdir -m 'core_examples or yaml_api or yaml_search_space'" -markers = ["all_examples", "core_examples", "regression_all", "metahyper", "yaml_api", "summary_csv", - "yaml_search_space"] +addopts = "--basetemp ./tests_tmpdir -m 'core_examples or yaml_api'" +markers = ["all_examples", "core_examples", "regression_all", "metahyper", "yaml_api", "summary_csv"] filterwarnings = "ignore::DeprecationWarning:torch.utils.tensorboard.*:" [tool.mypy] diff --git a/tests/test_yaml_search_space/test_search_space.py b/tests/test_yaml_search_space/test_search_space.py index 9d81c5f1..b76488ef 100644 --- a/tests/test_yaml_search_space/test_search_space.py +++ b/tests/test_yaml_search_space/test_search_space.py @@ -4,7 +4,7 @@ from neps.search_spaces.search_space import pipeline_space_from_yaml -@pytest.mark.yaml_search_space +@pytest.mark.yaml_api def test_correct_yaml_file(): """Test the function with a correctly formatted YAML file.""" pipeline_space = pipeline_space_from_yaml( @@ -35,7 +35,7 @@ def test_correct_yaml_file(): assert pipeline_space["dropout_rate"].is_fidelity is False -@pytest.mark.yaml_search_space +@pytest.mark.yaml_api def test_correct_including_priors_yaml_file(): """Test the function with a correctly formatted YAML file.""" pipeline_space = pipeline_space_from_yaml( @@ -66,21 +66,21 @@ def test_correct_including_priors_yaml_file(): assert pipeline_space["dropout_rate"].is_fidelity is True -@pytest.mark.yaml_search_space +@pytest.mark.yaml_api def test_incorrect_yaml_file(): """Test the function with an incorrectly formatted YAML file.""" with pytest.raises(ValueError): pipeline_space_from_yaml("tests/test_yaml_search_space/incorrect_config.txt") -@pytest.mark.yaml_search_space +@pytest.mark.yaml_api def test_yaml_file_with_missing_key(): """Test the function with a YAML file missing a required key.""" with pytest.raises(KeyError): pipeline_space_from_yaml("tests/test_yaml_search_space/missing_key_config.yml") -@pytest.mark.yaml_search_space +@pytest.mark.yaml_api def test_yaml_file_with_inconsistent_types(): """Test the function with a YAML file having inconsistent types for 'lower' and 'upper'."""