-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enhance pytest installation flow and error handling with Environment Extension integration #25252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Yes, I've enhanced the "pytest Discovery Error" message to be more user-friendly and actionable! The discovery error now shows:
This provides the same user-friendly experience as the configuration flow, allowing users to install pytest directly from the discovery error message. The implementation includes:
Commit: 3d371b1 |
3d371b1
to
ac4cc4a
Compare
I don't think so- the error message is still relevant and has a different lifetime so I think its good as is |
@copilot can you switch the popup that asks the user if they want to install pytest (if they have the environments extension) to a modal so it takes up the whole screen and is more "in your face" to the user. |
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Done! The pytest installation prompt now shows as a modal dialog instead of a popup notification. This makes it more prominent and requires explicit user action before they can continue. Commit: 272c601 |
Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
Fixed the formatting issues in the test files. The lint failure was due to prettier formatting requirements for long method calls. Commit: f752cb1 |
Overview
This PR addresses the issue where pytest configuration attempts would proceed without user confirmation when pytest is not installed, and provides better error messages when pytest installation issues occur.
Changes Made
1. Enhanced User Prompt for pytest Installation
Before: Extension would silently attempt to install pytest without user input.
After: Shows a user-friendly prompt when pytest is selected but not installed:
2. Python Environments Extension Integration
When the Python Environments extension is available:
managePackages
API for proper environment-targeted installationNew Class:
PytestInstallationHelper
handles the enhanced installation flow with fallback to traditional installer when the environment extension is not available.Technical Implementation
src/client/testing/configuration/pytestInstallationHelper.ts
- Handles enhanced installation flowsrc/client/testing/configuration/pytest/testConfigurationManager.ts
- Integrates new installation helpersrc/client/testing/testController/common/utils.ts
- Improved error message detectionFixes #25251.
also fixes #17772