Skip to content

Commit fe19b99

Browse files
[MNT] Standardize pytest markers and update documentation
- Rename 'uses_test_server' to 'test_server' globally. - Standardize 'production' to 'production_server' in documentation and CI. - Register new markers and remove unused 'server' marker in pyproject.toml. - Fix indentation in pyproject.toml markers list. - Update 'docs/developer_setup.md' with new markers and examples. - Remove redundant marker registration in 'tests/conftest.py'.
1 parent c182e0f commit fe19b99

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ jobs:
114114
fi
115115
116116
if [ "${{ matrix.sklearn-only }}" = "true" ]; then
117-
marks="sklearn and not production_server and not uses_test_server"
117+
marks="sklearn and not production_server and not test_server"
118118
else
119-
marks="not production_server and not uses_test_server"
119+
marks="not production_server and not test_server"
120120
fi
121121
122122
pytest -n 4 --durations=20 --dist load -sv $codecov -o log_cli=true -m "$marks"
@@ -131,9 +131,9 @@ jobs:
131131
fi
132132
133133
if [ "${{ matrix.sklearn-only }}" = "true" ]; then
134-
marks="sklearn and production_server and not uses_test_server"
134+
marks="sklearn and production_server and not test_server"
135135
else
136-
marks="production_server and not uses_test_server"
136+
marks="production_server and not test_server"
137137
fi
138138
139139
pytest -n 4 --durations=20 --dist load -sv $codecov -o log_cli=true -m "$marks"
@@ -143,7 +143,7 @@ jobs:
143143
env:
144144
OPENML_TEST_SERVER_ADMIN_KEY: ${{ secrets.OPENML_TEST_SERVER_ADMIN_KEY }}
145145
run: | # we need a separate step because of the bash-specific if-statement in the previous one.
146-
pytest -n 4 --durations=20 --dist load -sv --reruns 5 --reruns-delay 1 -m "not uses_test_server"
146+
pytest -n 4 --durations=20 --dist load -sv --reruns 5 --reruns-delay 1 -m "not test_server"
147147
148148
- name: Check for files left behind by test
149149
if: matrix.os != 'windows-latest' && always()

docs/developer_setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ The OpenML Python SDK utilizes `pytest` markers to categorize tests based on dep
170170
| Marker | Description |
171171
|-------------------|-----------------------------------------------------------------------------|
172172
| `sklearn` | Tests requiring `scikit-learn`. Skipped if the library is missing. |
173-
| `production` | Tests that interact with the live OpenML server (real API calls). |
174-
| `uses_test_server` | Tests requiring the OpenML test server environment. |
173+
| `production_server`| Tests that interact with the live OpenML server (real API calls). |
174+
| `test_server` | Tests requiring the OpenML test server environment. |
175175

176176
### Execution Examples
177177

@@ -190,7 +190,7 @@ pytest -m sklearn
190190
Exclude production tests (local only):
191191

192192
```bash
193-
pytest -m "not production"
193+
pytest -m "not production_server"
194194
```
195195

196196
### Admin Privilege Tests

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ filterwarnings=[
134134
]
135135
markers = [
136136
"upload: anything that uploads to a server",
137-
"production_server: any interaction with the production server",
138-
137+
"production_server: any interaction with the production server",
139138
"cache: anything that interacts with the (test) cache",
140139
"test_server: tests that require the OpenML test server",
141140
]

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ def pytest_sessionfinish() -> None:
189189

190190
def pytest_configure(config):
191191
config.addinivalue_line("markers", "sklearn: marks tests that use scikit-learn")
192-
config.addinivalue_line("markers", "production_server: marks tests that use the production server")
193192

194193

195194
def pytest_addoption(parser):

0 commit comments

Comments
 (0)