问题
Pytest 使用nodeid运行测试用例,代码如下
#test_a.py
import pytest
def test_one():
pass
class TestNode:
def test_one(self):
pass
@pytest.mark.parametrize(“x, y”, [(1,3), (3, 5)])
def test_two(self, x, y):
assert x+2 == y
我想指定某一个参数去运行比如:
pytest test_a.py::TestNode::test_two[1-3]
报错信息
zsh: no matches found: test_a.py::TestNode::test_two[1-3]