首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >鼻子能和Pytest一起使用吗?

鼻子能和Pytest一起使用吗?
EN

Stack Overflow用户
提问于 2019-10-18 14:38:56
回答 1查看 40关注 0票数 0

我在PyCharm中使用pytest作为我的测试运行程序,但是当我尝试从Pytest中启动鼻尖时,它不会识别Pytest注释。

run_tests.py

代码语言:javascript
复制
def run_tests():
    from proboscis import TestProgram
    import test_pytest_param

    # Run Proboscis and exit.
    TestProgram().run_and_exit()

if __name__ == '__main__':
    # Instead of running as main, try to run tests with pytest
    pass 

def test_run_proboscis_as_pytest():
    run_tests()

test_pytest_param.py

代码语言:javascript
复制
import pytest


def is_negative(n):
    return n < 0

@pytest.mark.parametrize("x",[7, -7])
def test_is_negative(x):
    assert is_negative(x) 

这在TypeError: test_is_negative() missing 1 required positional argument: 'x'中失败

我能以某种方式,也许用命令行运行Pytest吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-21 14:09:09

我与“Proboscis”的作者进行了交流,他写道,它不能与PyTest一起运行。PyTest的插件将比移植Proboscis更有意义,因为PyTest的工作方式与鼻子/ UnitTest非常不同。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58453072

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档