pytest.param
含义
使用
含义
param: 在 pytest.mark.parametrize 中可以作为一个指定的参数进行调用。
源码:
?...使用
import pytest
@pytest.mark.parametrize("test_input, expected", [
("3+5", 8),
pytest.param...("6*9", 42, marks=pytest.mark.xfail),
])
def test_eval(test_input, expected):
assert eval...id 使用:
import pytest
@pytest.mark.parametrize("test_input, expected", [
("3+5", 8),...pytest.param("6*9", 54, marks=pytest.mark.xfail, id="this case -- xfail"),
])
def test_eval(test_input