【问题标题】:How do you get Nose2 tests to run on Visual Studio Code?如何让 Nose2 测试在 Visual Studio Code 上运行?
【发布时间】:2019-03-06 15:55:36
【问题描述】:

我正在尝试在为 Nose 2 编写的 Visual Studio Code 中运行测试。Python 扩展中的 unittest 和 nosetests 选项似乎都无法正确发现测试。

测试用例位于从根目录向下几级的子目录中的多个 python 文件中,例如:

(root)/test_suite/test_cases/[test script files]

如何让 Visual Studio Code 发现这些测试?我过去在这个项目中使用过 PyCharm,它在测试发现方面没有问题。

【问题讨论】:

  • 我也在尝试回答你的问题,但如果没有规范的方法,我们可以使用custom tasks

标签: python visual-studio-code nose2


【解决方案1】:

您可以通过设置为鼻子(或单元测试)指定参数,例如"python.unitTest.nosetestArgs",因此您应该能够构造适当的参数来发现该目录中的测试。

【讨论】:

    猜你喜欢
    • 2017-06-16
    • 1970-01-01
    • 2015-07-09
    • 2016-03-08
    • 2014-03-14
    • 1970-01-01
    • 2023-04-09
    • 1970-01-01
    • 2023-04-08
    相关资源
    最近更新 更多