[MNT] Replace Live Server Calls with Mocks in Unit Tests
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 361
- Fork
- 296
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openml/openml-python
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
openml/openml-python#1750 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
openml/openml-python#1749 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
openml/openml-python#1746 ·
-
Documentation Good First Issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
openml/openml-python#1708 · 7 commenti ·
-
Good First Issue module:Run testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openml/openml-python#1646 · 7 commenti · 2 reazioni ·
Tutte le issue di openml/openml-python
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
huggingface/Repo2RLEnv#163 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
NousResearch/hermes-agent#121143 ·