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 for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube