简体   繁体   English

如何在 Visual Studio 代码中内置运行 python tox 命令和测试

[英]How to built-in run python tox command and test in visual studio code

I have tox.ini in my project, and I want for running and showing test in visual studio code, using python tox, but I don't know how to do it?我的项目中有 tox.ini,我想在 Visual Studio 代码中运行和显示测试,使用 python tox,但我不知道该怎么做?

As far as I know there is no tox extension for VS Code.据我所知,VS Code 没有tox扩展。

I just open the integrated terminal within VS Code and run it.我只是在 VS Code 中打开集成终端并运行它。

You can also run any external tool, eg tox via a so-called task, see https://code.visualstudio.com/docs/editor/tasks您还可以通过所谓的任务运行任何外部工具,例如tox ,请参阅https://code.visualstudio.com/docs/editor/tasks

Update: since June 2021 there is a Visual Studio Code extension for tox: python-tox .更新:自 2021 年 6 月以来,一个用于 tox 的 Visual Studio Code 扩展: python-tox

To use:要使用:

  1. Install the extension安装扩展
  2. Ensure that tox is installed in the base version of Python running on your OS确保在您的操作系统上运行的 Python 的基本版本中安装了 tox
  3. Open the command palette (Cmd-Shift-P on a Mac)打开命令面板(Mac 上的 Cmd-Shift-P)
  4. Type tox tox
  5. Select from one of the available commands (see the extension homepage for details) Select 来自可用命令之一(有关详细信息,请参阅扩展主页)

Disclaimer: I am not the author of the extension, but kudos to the author.免责声明:我不是扩展的作者,但作者表示敬意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM