【发布时间】:2018-06-08 19:25:27
【问题描述】:
我想自定义我的 pytest 的输出名称以包含我的灯具名称
所以我有
def test_t1(
when_creating_a_project_from_a_sales_handoff,
with_a_new_customer,
and_no_conflicting_data_exists,
create_project):
it_will_create_a_customer_with_the_releavant_information()
it_will_create_a_project_that_references_the_newly_created_customer()
我希望显示的测试名称是某个版本的
when_creating_a_project_from_a_sales_handoff
with_a_new_customer
and_no_conflicting_data_exists
create_project
我该怎么做?我尝试创建
@fixture
def namer(request):
request.node.name = 'test_foo'
但没有骰子,它没有改变测试显示名称
【问题讨论】: