[MNT] Replace Live Server Calls with Mocks in Unit Tests
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- testing-qa
Línea de trabajo
Start by inspecting the listed test files for the production_server and test_server markers, then read openml._api_calls._send_request and its requests.Session usage. Replace the remote calls with mocks or patches in a focused test-file subtask, and run the affected pytest tests to confirm they pass without contacting the live server.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Several tests currently rely on direct connections to the live server (production/test), which can cause race conditions, server overload, and sporadic failures (see https://github.com/openml/openml-python/issues/1586). To ensure these remain true unit tests, they should use mocks/patches instead of the remote server.
Steps:
- Identify tests using the remote server, e.g., marked with
"production_server"or"test_server". - Mock or patch
requests.Sessionin tests relying onopenml._api_calls._send_request. Alternatively, higher-level mocking can be used to simplify implementation.
Affected test files (can be separate sub-tasks/PRs):
- test_datasets/test_dataset_functions.py
- test_datasets/test_dataset.py
- test_evaluations/test_evaluation_functions.py
- test_flows/test_flow_functions.py
- test_flows/test_flow.py
- test_openml/test_api_calls.py
- test_runs/test_run_functions.py
- test_runs/test_run.py
- test_runs/test_trace.py
- test_setups/test_setup_functions.py
- test_study/test_study_functions.py
- test_tasks/test_classification_task.py
- test_tasks/test_clustering_task.py
- test_tasks/test_learning_curve_task.py
- test_tasks/test_regression_task.py
- test_tasks/test_supervised_task.py
- test_tasks/test_task_functions.py
- test_tasks/test_task_methods.py
- test_tasks/test_task.py
- test_utils/test_utils.py
- Lenguaje dominante
- Python
- Estrellas
- 361
- Forks
- 296
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openml/openml-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
openml/openml-python#1749 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
openml/openml-python#1746 ·
-
Documentation Good First Issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
openml/openml-python#1708 · 6 comentarios ·
-
Good First Issue module:Run testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openml/openml-python#1646 · 7 comentarios · 2 reacciones ·
-
Good First Issue module:Data testing
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openml/openml-python#1644 · 4 comentarios ·
Todos los issues de openml/openml-python
Issues similares
-
essnmx good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
[Feature] 奇物选择添加优先级 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
syfoud/Simulated_Scepter#174 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Giskard-AI/giskard-oss#2840 · 1 comentario ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Abiertoarea: repo bug perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yeti-platform/yeti#1380 ·