Ability to run single test methods or classes
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start at the unit_testing build target and its existing support for module patterns, using the build configuration for test_create_snippet_from_sel.py as the reference case. Trace how a pattern is passed to the test runner, then verify that pytest-style paths can select a test class and method as requested.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This is a common use case, supported both by unittest and pytest. E.g. in unittest I can run an individual test method with:
python3 -m unittest somelib.tests.test_process.TestProcess.test_kill
With pytest:
python3 -m pytest mylib/tests/test_process.py::TestProcess::test_kill
Apparently with UnitTesting it's possible to specify a single test module to run, but not a test class or a test method.
Right now I am running individual test modules by using this build config:
"build_systems": [
{
"name": "Sublime tests:",
"target": "unit_testing",
"package": "mypackage",
"variants": [
{"name": "test_create_snippet_from_sel.py", "pattern": "test_create_snippet_from_sel.py"},
]
}
I would like to be able to specify something like (mimicking pytest style):
{"name": "test_kill", "pattern": "test_create_snippet_from_sel.py::TestProcess::test_kill"},
To give even more context about my specific use case: I have a dynamic build system able to run individual test methods based on the cursor position (see ST forum post). I did this for both pytest and unittest. I would like to do the same by using UnitTesting.
@randy3k if you like the idea I can try working on a PR.
- Lenguaje dominante
- Python
- Estrellas
- 113
- Forks
- 32
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 SublimeText/UnitTesting
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
SublimeText/UnitTesting#286 · 3 comentarios ·
-
testing dependencies in 3.8 Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
SublimeText/UnitTesting#276 · 4 comentarios ·
-
Run tests for installed packages Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
SublimeText/UnitTesting#155 · 8 comentarios ·
-
Testing against dev builds Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
SublimeText/UnitTesting#31 · 5 comentarios ·
Todos los issues de SublimeText/UnitTesting
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
use-agent-os/agent-os#3314 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
BasedHardware/omi#15662 · 1 comentario ·
-
documentation help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
AiursoftWeb/AnduinOS-2#19 ·