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

  • AdaBoost Binary Classification Using C#

    Dr. James McCaffrey from Microsoft Research presents a C# program that illustrates using the AdaBoost algorithm to perform binary classification for spam detection. Compared to other classification algorithms, AdaBoost is powerful and works well with small datasets, but is sometimes susceptible to model overfitting.

  • From Core to Containers to Orchestration: Modernizing Your Azure Compute

    The cloud changed IT forever. And then containers changed the cloud. And then Kubernetes changed containers. And then microservices usurped monoliths, and so it goes in the cloudscape. Here's help to sort it all out.

  • The Well-Architected Architect on Azure

    In the dynamic field of cloud computing, the architect's role is increasingly pivotal as they must navigate a complex landscape, considering everything from the overarching architecture and individual service configurations to the various trade-offs involved. Here's help.

  • Windows Community Toolkit Update Improves Controls

    The Windows Community Toolkit advanced to version 8.1, adding new features, improving existing controls and making dependency changes.

Subscribe on YouTube