Ability to run single test methods or classes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 113
- Fork
- 32
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SublimeText/UnitTesting
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
SublimeText/UnitTesting#286 · 3 bình luận ·
-
testing dependencies in 3.8 Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
SublimeText/UnitTesting#276 · 4 bình luận ·
-
Run tests for installed packages Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
SublimeText/UnitTesting#155 · 8 bình luận ·
-
Testing against dev builds Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
SublimeText/UnitTesting#31 · 5 bình luận ·
Tất cả issue của SublimeText/UnitTesting
Issue tương tự
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100