我在PyCharm中使用pytest作为我的测试运行程序,但是当我尝试从Pytest中启动鼻尖时,它不会识别Pytest注释。
run_tests.py
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
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吗?
发布于 2019-10-21 14:09:09
我与“Proboscis”的作者进行了交流,他写道,它不能与PyTest一起运行。PyTest的插件将比移植Proboscis更有意义,因为PyTest的工作方式与鼻子/ UnitTest非常不同。
https://stackoverflow.com/questions/58453072
复制相似问题