【发布时间】:2020-07-09 13:31:43
【问题描述】:
我通常使用这个命令从我的项目根目录运行我的 python (3.6) 单元测试
python -m unittest discover -v -s . -p "test_*.py"
但是,我无法使用 vscode 进行设置。我的配置是
"python.testing.unittestArgs": ["-v", "-s", ".", "-p", "test_*.py"],
"python.testing.pytestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.unittestEnabled": true
我收到了消息
No tests discovered, please check the configuration settings for the tests.
如何更正我的 vscode 设置以运行单元测试。
【问题讨论】:
-
您在命令行和 VS Code 配置中使用不同的测试路径。对吗?
-
糟糕,抱歉,我在 vscode 设置中尝试了各种路径。现已更正。
-
查看
Python Test Log输出中显示的内容。您可以在View->Output-> 中找到它,然后在控制台右侧选择输出类型。
标签: python unit-testing visual-studio-code