vscode中配置pytest

时间:2020-08-28 22:51:51   收藏:0   阅读:903

在setting.json中输入一下内容:

    "python.testing.pytestArgs": [
        ".",
        "--capture=no"
    ],  
    "python.testing.unittestEnabled": false,
    "python.testing.nosetestsEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.promptToConfigure": false,
    "python.testing.autoTestDiscoverOnSaveEnabled": false,
    

其中:"--capture=no"表示pytest不捕获测试用例中的print,直接在控制台显示出来,其它的pytest参数,如下所示:

几个常用的参数,展示运行的写法:



原文:https://www.cnblogs.com/gwzz/p/13578244.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!