Skip to content

Conversation

Copy link

Copilot AI commented Jul 8, 2025

Problem

When running "Python: Configure Tests" from the command palette without first opening Python files, the command fails with "command 'python.configureTests' not found" error as shown in the issue screenshot.

Root Cause

The extension's activation events in package.json were missing onCommand:python.configureTests. The command is only registered when the UnitTestManagementService activates via the registerCommands() method, but without the proper activation event, the extension doesn't activate when the command is invoked directly from the command palette.

Solution

Added onCommand:python.configureTests to the activationEvents array in package.json. This ensures the Python extension activates automatically when the command is invoked, allowing the command registration to occur before execution.

Changes

  • package.json: Added onCommand:python.configureTests to activation events
  • New test: Added unit tests to validate the activation event configuration

The fix follows the existing pattern - onCommand:python.copilotSetupTests was already present for the related copilot setup command.

Verification

  • ✅ Extension compiles successfully
  • ✅ All existing tests pass
  • ✅ New unit tests verify activation event configuration
  • ✅ Linting and formatting checks pass

This minimal change ensures users can run "Python: Configure Tests" directly from the command palette in any workspace state without encountering the "command not found" error.

Fixes #22783.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Python: Configure Tests command not found Fix "Python: Configure Tests" command not found error by adding activation event Jul 8, 2025
Copilot AI requested a review from eleanorjboyd July 8, 2025 16:19
Copilot finished work on behalf of eleanorjboyd July 8, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Configure Tests command not found

2 participants