Description
The Python extension has several test-discovery workflows that depend on workspace state, test configuration, and file changes.
It would be useful to add focused regression coverage for the behavior of test discovery after a workspace is reloaded or reopened, particularly when automatic test discovery is enabled.
The goal is to ensure that the extension consistently initializes test discovery without requiring an unnecessary manual refresh.
Proposed scenarios
Add automated coverage for:
- Open a workspace containing a configured pytest project.
- Enable pytest test discovery.
- Reload the VS Code window.
- Verify that test discovery is initialized correctly.
- Verify that the expected tests become available in Test Explorer.
- Modify/save a test file and verify that discovery behavior follows the configured discovery settings.
- Verify behavior when automatic test discovery is disabled.
Expected behavior
Test discovery should initialize consistently according to the configured testing settings after a workspace reload.
If manual Test: Refresh Tests is intentionally required in any scenario, the expected behavior should be documented and covered by a regression test.
Why this is useful
Test discovery is a core workflow of the Python extension, and regressions in initialization can make users believe that their tests are not configured correctly.
Adding focused coverage would:
- prevent regressions in workspace reload behavior;
- make the expected discovery lifecycle explicit;
- improve confidence when modifying the testing subsystem;
- provide maintainers with reproducible automated coverage for future changes.
Scope
This issue is intended as a focused testing/regression-coverage improvement rather than a redesign of the test-discovery architecture.
I would be happy to contribute the tests and investigate the relevant test-discovery code paths.
Description
The Python extension has several test-discovery workflows that depend on workspace state, test configuration, and file changes.
It would be useful to add focused regression coverage for the behavior of test discovery after a workspace is reloaded or reopened, particularly when automatic test discovery is enabled.
The goal is to ensure that the extension consistently initializes test discovery without requiring an unnecessary manual refresh.
Proposed scenarios
Add automated coverage for:
Expected behavior
Test discovery should initialize consistently according to the configured testing settings after a workspace reload.
If manual
Test: Refresh Testsis intentionally required in any scenario, the expected behavior should be documented and covered by a regression test.Why this is useful
Test discovery is a core workflow of the Python extension, and regressions in initialization can make users believe that their tests are not configured correctly.
Adding focused coverage would:
Scope
This issue is intended as a focused testing/regression-coverage improvement rather than a redesign of the test-discovery architecture.
I would be happy to contribute the tests and investigate the relevant test-discovery code paths.