Ability to run single test methods or classes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 113
- Fork
- 32
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 SublimeText/UnitTesting
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
SublimeText/UnitTesting#286 · 3 commenti ·
-
testing dependencies in 3.8 Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
SublimeText/UnitTesting#276 · 4 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
SublimeText/UnitTesting#155 · 8 commenti ·
-
Testing against dev builds Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
SublimeText/UnitTesting#31 · 5 commenti ·
Tutte le issue di SublimeText/UnitTesting
Issue simili
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
apache/cloudstack#14222 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100