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

  • Hands On: New VS Code Insiders Build Creates Web Page from Image in Seconds

    New Vision support with GitHub Copilot in the latest Visual Studio Code Insiders build takes a user-supplied mockup image and creates a web page from it in seconds, handling all the HTML and CSS.

  • Naive Bayes Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the naive Bayes regression technique, where the goal is to predict a single numeric value. Compared to other machine learning regression techniques, naive Bayes regression is usually less accurate, but is simple, easy to implement and customize, works on both large and small datasets, is highly interpretable, and doesn't require tuning any hyperparameters.

  • VS Code Copilot Previews New GPT-4o AI Code Completion Model

    The 4o upgrade includes additional training on more than 275,000 high-quality public repositories in over 30 popular programming languages, said Microsoft-owned GitHub, which created the original "AI pair programmer" years ago.

  • Microsoft's Rust Embrace Continues with Azure SDK Beta

    "Rust's strong type system and ownership model help prevent common programming errors such as null pointer dereferencing and buffer overflows, leading to more secure and stable code."

  • Xcode IDE from Microsoft Archrival Apple Gets Copilot AI

    Just after expanding the reach of its Copilot AI coding assistant to the open-source Eclipse IDE, Microsoft showcased how it's going even further, providing details about a preview version for the Xcode IDE from archrival Apple.

Subscribe on YouTube

Upcoming Training Events