tests: discuss removing dotenv environment mutation during TTS collection
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Read tests/test_tts.py, especially the module level load_dotenv(override=True) call and the collection time PLUGIN filtering. First reproduce the overwrite in a subprocess using a temporary .env and dummy values, then determine how provider selection and credentials should be prepared explicitly for TTS tests. Done means collect only preserves preexisting environment values while intentional TTS configuration still works.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
While auditing test import-time side effects after #8134, I noticed that tests/test_tts.py calls load_dotenv(override=True) at module scope.
At main commit 2a1c02d17cb90244dc27a8161ff4825707430665, this is at line 56:
https://github.com/livekit/agents/blob/2a1c02d17cb90244dc27a8161ff4825707430665/tests/test_tts.py#L56
Importing the module during collection can therefore replace pre-existing process environment values with values from a discovered .env, even when no test executes. Later in the same module, the PLUGIN environment variable controls parameter filtering, so preserving intentional collection-time configuration needs care.
This module already has the tts category marker. Category filtering protects --unit runs; this report concerns collection when the TTS module is selected or pytest runs without a category filter. I am not claiming the current unit gate imports it or that this causes a model download.
Verification
I parsed the test module, extracted its module-level load_dotenv(override=True) expression, and executed that expression using the real python-dotenv loader with an explicit temporary .env path. With a dummy variable initially set to from-shell and the temporary file setting it to from-dotenv, the expression overwrote the original value. No real credentials were used or inspected.
This is an isolated verification of the statement's overwrite behavior, not a full pytest collection reproduction. A regression test should exercise collection in a subprocess with a temporary .env and dummy values.
Proposed scope for discussion
Would you welcome a small follow-up that removes implicit environment mutation from importing this module and makes dotenv preparation explicit for TTS test execution?
The implementation would preserve intentional provider selection and credential setup, and verify that collect-only does not overwrite dummy environment values. Since PLUGIN is read during collection, simply moving everything into an autouse fixture would be insufficient; I would agree on the intended configuration path before implementing it.
No production behavior, changelogs, package manifests, or version files would change. I have not started an implementation and would appreciate guidance on the preferred scope.
- Lenguaje dominante
- Python
- Estrellas
- 14.6k
- Forks
- 3.9k
- Merge medio
- 2 d 6 h
- PR fusionados (30 d)
- 227
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 livekit/agents
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
mistralai: expose reasoning_effort on the LLMPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
ci: unit tests pin Python 3.12 while the package advertises 3.14 supportPosiblemente ocupada @huong8373tt-beep la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
livekit/agents#8231 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Assistant markup is stripped from chat history when expressive mode is offPosiblemente ocupada @ShivamSharma43 la tomó hace 22 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7647 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsQuizá libre de nuevo @AbarnaaSree la tomó hace 62 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7022 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de livekit/agents
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
aws-samples/sample-per-model-bedrock#639 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
awslabs/visual-asset-management-system#937 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
project-codeflare/codeflare-sdk#1195 ·
Los mantenedores suelen responder en 1 día
-
Bump numpy dependencyAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
pandas-dev/pandas-stubs#2051 ·
Los mantenedores suelen responder en 1 día