-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
Python 3.6.8
pytest-6.1.2
cases-2.5.0
Test flask application
test_file
@pytest.fixture
def barToFoo():
app.config["foo"]["bar"] = "foo"
yield
app.config["foo"]["bar"] = "bar"
@parametrize_with_cases("inputs,request_data", prefix="case_create_")
@pytest.mark.usefixtures("clearMongo", "mocked_oid", "mocked_uuid")
def test_create(db, flaskClient, inputs, request_data):
...
db, flaskClient, clearMongo, mocked_oid, mocked_uuid - fixtures
case file
class CreateCases(object):
@case(id="simple")
def case_create_2(self, barToFoo):
inputs = ["foo", "bar"]
request_data = {"foo": "dfg", "data": "asd"}
return inputs, request_data
Test name is test_create[inputs_request_data_is_simple]. Without fixture barToFoo in params case_create_2, test name is test_create[simple].
How do i get the name test_create[simple] with fixture barToFoo?
Metadata
Metadata
Assignees
Labels
No labels