我有一个测试用例,其中 parametrize 装饰器使用迭代器(接收两个路径文件作为参数)来测试其有效性。
def iter_wb_results(expected_path, test_path):
test_file = open(test_path, "r")
...
@pytest.mark.parametrize("first, second", iter_wb_results(EXPECTED_RESULTS_PATH, TEST_PATH), ids=repr)
def test_cell_compare(first, second):
assert first == second, "No way"
问题是如何从命令行将参数( EXPECTED_RESULTS_PATH,TEST_PATH )传递给迭代器( iter_wb_results )?