Skip to content

Commit f183d11

Browse files
committed
tests: updated tests to use the env var for key instead of hardcoding it
Signed-off-by: rohansen856 <rohansen856@gmail.com>
1 parent 808ab63 commit f183d11

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_datasets/test_dataset_functions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,10 @@ def _assert_status_of_dataset(self, *, did: int, status: str):
572572
assert len(result) == 1
573573
assert result[did]["status"] == status
574574

575+
@pytest.mark.skipif(
576+
not os.environ.get(openml.config.OPENML_TEST_SERVER_ADMIN_KEY_ENV_VAR),
577+
reason="Test requires admin key. Set OPENML_TEST_SERVER_ADMIN_KEY environment variable.",
578+
)
575579
@pytest.mark.flaky()
576580
def test_data_status(self):
577581
dataset = OpenMLDataset(

tests/test_openml/test_config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ def test_setup_with_config(self):
106106

107107

108108
class TestConfigurationForExamples(openml.testing.TestBase):
109+
@pytest.mark.skipif(
110+
not os.environ.get(openml.config.OPENML_TEST_SERVER_ADMIN_KEY_ENV_VAR),
111+
reason="Test requires admin key. Set OPENML_TEST_SERVER_ADMIN_KEY environment variable.",
112+
)
109113
@pytest.mark.production()
110114
def test_switch_to_example_configuration(self):
111115
"""Verifies the test configuration is loaded properly."""

0 commit comments

Comments
 (0)