Skip to content

Commit 2cee514

Browse files
moved `@pytest.mark.uses_test_server()
` to class level
1 parent 1b63cb1 commit 2cee514

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

tests/test_api/test_setup.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def get_sentinel():
2727
sentinel = md5.hexdigest()[:10]
2828
return f"TEST{sentinel}"
2929

30+
@pytest.mark.uses_test_server()
3031
class TestSetupV1(TestAPIBase):
3132
"""Tests for V1 XML API implementation of setups."""
3233

@@ -38,15 +39,13 @@ def setUp(self) -> None:
3839
self.resource = SetupV1API(http_client)
3940
self.extension = SklearnExtension()
4041

41-
@pytest.mark.uses_test_server()
4242
def test_list(self):
4343
setups = self.resource.list(limit=10, offset=0)
4444

4545
assert isinstance(setups, list)
4646
assert len(setups) > 0
4747
assert all(isinstance(s, OpenMLSetup) for s in setups)
4848

49-
@pytest.mark.uses_test_server()
5049
def test_get(self):
5150
setup_id = 1
5251
setup = self.resource.get(setup_id)
@@ -55,7 +54,6 @@ def test_get(self):
5554
assert setup.setup_id == setup_id
5655

5756
@pytest.mark.sklearn()
58-
@pytest.mark.uses_test_server()
5957
def test_exists_nonexisting_setup(self):
6058
"""Test exists() returns False when setup doesn't exist"""
6159
# first publish a non-existing flow
@@ -76,7 +74,6 @@ def test_exists_nonexisting_setup(self):
7674
assert not setup_id
7775

7876
@pytest.mark.sklearn()
79-
@pytest.mark.uses_test_server()
8077
def test_exists_existing_setup(self):
8178
"""Test exists() returns setup_id when setup exists"""
8279
flow = self.extension.model_to_flow(sklearn.naive_bayes.GaussianNB())
@@ -105,7 +102,7 @@ def test_exists_existing_setup(self):
105102
setup_id = self.resource.exists(flow, openml_param_settings)
106103
assert setup_id == run.setup_id
107104

108-
105+
@pytest.mark.uses_test_server()
109106
class TestSetupV2(TestAPIBase):
110107
"""Tests for V2 JSON API implementation of setups."""
111108

@@ -117,19 +114,16 @@ def setUp(self) -> None:
117114
self.resource = SetupV2API(http_client)
118115
self.extension = SklearnExtension()
119116

120-
@pytest.mark.uses_test_server()
121117
def test_list(self):
122118
with pytest.raises(OpenMLNotSupportedError):
123119
self.resource.list(limit=10, offset=0)
124120

125-
@pytest.mark.uses_test_server()
126121
def test_get(self):
127122
with pytest.raises(OpenMLNotSupportedError):
128123
setup_id = 1
129124
self.resource.get(setup_id)
130125

131126
@pytest.mark.sklearn()
132-
@pytest.mark.uses_test_server()
133127
def test_exists_nonexisting_setup(self):
134128
# first publish a non-existing flow
135129
sentinel = get_sentinel()
@@ -149,7 +143,6 @@ def test_exists_nonexisting_setup(self):
149143
self.resource.exists(flow, openml_param_settings)
150144

151145
@pytest.mark.sklearn()
152-
@pytest.mark.uses_test_server()
153146
def test_exists_existing_setup(self):
154147
flow = self.extension.model_to_flow(sklearn.naive_bayes.GaussianNB())
155148
flow.name = f"{get_sentinel()}{flow.name}"

0 commit comments

Comments
 (0)