Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Testing: session scoped fixture for required model loading

Abierto
#1 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
testing-qa

Línea de trabajo

Comienza con tests/load_models.py, tests/unload_models.py y conftest.py; después revisa el flujo de trabajo existente de tox -e load-test-models y las indicaciones vinculadas sobre fixtures y markers de pytest. Implementa una gestión con ámbito de sesión que detecte las pruebas lmstudio seleccionadas, realice un seguimiento opcional de sus IDs de modelo y conserve los modelos necesarios; se considera terminado cuando las pruebas ya no requieren una configuración separada para cargar modelos y -m "not lmstudio" evita cargarlos.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The tests/load_models.py/tests/unload_models.py scripts that handle loading and unloading the models used by the test suite currently need to be invoked separately from the test suite execution.

While this approach works, it does mean that you can easily get spurious failures if you forget to run tox -e load-test-models before a local testing session.

We could potentially add a session scoped fixture in conftest.py to get pytest to natively handle ensuring that the required models have been loaded rather than needing to manage it externally: https://stackoverflow.com/questions/76608690/pytest-best-practice-to-setup-and-teardown-before-and-after-all-tests

To avoid pointlessly setting up the models when -m "not lmstudio" has been passed, the fixture should scan the loaded modules and ensure the models are only loaded if that mark is present on at least one selected test (see https://docs.pytest.org/en/stable/example/markers.html and https://docs.pytest.org/en/stable/example/special.html)

To make it even more efficient, the lmstudio marker could potentially be parameterised with the model IDs that a given test expects to already have loaded. For example:

@pytest.mark.lmstudio(models=[EXPECTED_LLM_ID, EXPECTED_EMBEDDING_ID])
def test_list_downloaded_models_async() -> None:
    ...

When scanning the selected test nodes, the fixture would keep track of the named models, and ensure those models were loaded before running any tests. To avoid problems with unexpected JIT model unloading during the test suite execution, the fixture would still mark models to remain loaded indefinitely.

Lenguaje dominante
Python
Estrellas
885
Forks
168
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lmstudio-ai/lmstudio-python

Todos los issues de lmstudio-ai/lmstudio-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.