我在 PyCharm 中使用 pytest 作为我的测试运行程序,但是当我尝试从 Pytest 测试启动Proboscis时,它无法识别 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'
我可以用 Proboscis 以某种方式运行 Pytest,也许用命令行?