News

Test Explorer Added to VS Code Python Tool

A new Test Explorer highlights the February release of the Python extension for Visual Studio Code, by far the most popular tool in the marketplace, installed more than 6.5 million times.

The Python extension for Visual Studio Code enables features such as linting, debugging, IntelliSense, code navigation, code formatting, refactoring, unit tests, snippets and so on.

Reflecting VS Code's going "all in" on Python, the tool gets new functionality on a monthly basis, with the Test Explorer leading new improvements that also include debugging enhancements, new interactive window functionality and more.

"This release includes the ability to visualize, navigate and run unit tests through a test explorer, a feature that is commonly requested by our users," said Dan Taylor, principal program manager on the Python engineering team, in a blog post yesterday (Feb. 26). "To access it, you can run the command Python: Discover Unit Tests from the Command Palette (View -> Command Palette). If the unit test feature is disabled or no test framework is configured in the settings.json file, you'll be prompted to select a framework and configure it. Once tests are discovered, the Test Explorer icon will appear on the Activity Bar."

On the debugging front, breakpoint validation ensures a misplaced breakpoint will automatically be moved to a functional location. "If a breakpoint is set on a line where breakpoints are invalid (e.g. blank lines, pass statement, lines in the middle of a multi-line statement), then it's automatically moved to the nearest preceding valid line," Taylor said. "This way the breakpoints added are ensured to be hit. Previously the debugger would continue running past invalid breakpoints, causing confusion or wasted time."

The last major improvement called out by Taylor involves the Interactive window previously added to the tool and yet another top-requested feature: the ability to run code selections in the window without needing to define code cells. "With this update, you can now send any code line/selection to run in the Python Interactive window using command 'Python: Run Selection/Line in Python Interactive window,' " Taylor said.

The post also lists numerous other fixes, changes and tweaks for the free, open source tool, which as of this writing has been installed 6,588,613 times, downloaded 31,621,863 times and has earned an average 4.5 rating (scale to 5) from 220 developers who provided review feedback.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube