You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/testing_feature_area.instructions.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,7 @@ Project-based testing enables multi-project workspace support where each Python
182
182
4.**Test discovery**: For each project, the controller calls `project.discoveryAdapter.discoverTests()` with the project's URI. The adapter sets `PROJECT_ROOT_PATH` environment variable for the Python runner.
183
183
5.**Python side**:
184
184
- For pytest: `get_test_root_path()` in `vscode_pytest/__init__.py` returns `PROJECT_ROOT_PATH` (if set) or falls back to `cwd`.
185
-
- For unittest: `discovery.py` uses `PROJECT_ROOT_PATH` as `top_level_dir` and `cwd_override` to root the test tree at the project directory.
185
+
- For unittest: `discovery.py` uses `PROJECT_ROOT_PATH` as `top_level_dir` and `project_root_path` to root the test tree at the project directory.
186
186
6.**Test tree**: Each project gets its own root node in the Test Explorer, with test IDs scoped by project ID using the `@@vsc@@` separator (defined in `projectUtils.ts`).
187
187
188
188
### Nested project handling: pytest vs unittest
@@ -201,9 +201,9 @@ This approach was chosen because:
201
201
2. Implementing custom exclusion would add significant complexity with minimal benefit
202
202
3. The existing approach is transparent and predictable - each project shows what it finds
203
203
204
-
### Empty projects and hidden root nodes
204
+
### Empty projects and root nodes
205
205
206
-
**Important:**If a project discovers zero tests, its root node will **not appear** in the Test Explorer. This is by design - the test tree only shows projects that have actual tests.
206
+
If a project discovers zero tests, its root node will still appear in the Test Explorer as an empty folder. This ensures consistent behavior and makes it clear which projects were discovered, even if they have no tests yet.
207
207
208
208
### Logging prefix
209
209
@@ -213,17 +213,17 @@ All project-based testing logs use the `[test-by-project]` prefix for easy filte
213
213
214
214
- Python side:
215
215
-`python_files/vscode_pytest/__init__.py` — `get_test_root_path()` function and `PROJECT_ROOT_PATH` environment variable for pytest.
216
-
-`python_files/unittestadapter/discovery.py` — `discover_tests()` with `cwd_override` parameter and `PROJECT_ROOT_PATH` handling for unittest discovery.
217
-
-`python_files/unittestadapter/execution.py` — `run_tests()` with `cwd_override` parameter and `PROJECT_ROOT_PATH` handling for unittest execution.
216
+
-`python_files/unittestadapter/discovery.py` — `discover_tests()` with `project_root_path` parameter and `PROJECT_ROOT_PATH` handling for unittest discovery.
217
+
-`python_files/unittestadapter/execution.py` — `run_tests()` with `project_root_path` parameter and `PROJECT_ROOT_PATH` handling for unittest execution.
218
218
- TypeScript: `testProjectRegistry.ts`, `projectAdapter.ts`, `projectUtils.ts`, and the discovery/execution adapters.
-`src/test/testing/testController/common/projectUtils.unit.test.ts` — Project utility function tests
224
224
-`python_files/tests/pytestadapter/test_discovery.py` — pytest PROJECT_ROOT_PATH tests (see `test_project_root_path_env_var()` and `test_symlink_with_project_root_path()`)
0 commit comments