我想使用 pytest-bdd 编写一个类似小黄瓜的测试,为某些功能创建一组通用的测试数据。我不能使用给定添加多行,因为“给定步骤已被使用”。这样做的正确方法是什么?
我试过这个:
Background:
Given a user with Clerk privileges
And a household entry for "Alice" with SubmissionDate "Nov 26, 2019 3:59:50 pm"
And a household entry for "Bill" with SubmissionDate "Nov 27, 2019 3:59:50 pm"
这失败并显示以下消息:
E pytest_bdd.exceptions.GivenAlreadyUsed:
Fixture "add_household" that implements this
"a household entry for "Bill" with SubmissionDate "Nov 27, 2019 3:59:50 pm""
given step has been already used.