Skip to content

Question: Can someone explain the below uses of @pytest.mark.usefixtures #3308

@thakkardharmik

Description

@thakkardharmik

Question: Can someone explain the below two uses of @pytest.mark.usefixtures and how does each of them work. I would like to understand the difference in the marker and fixture definition/usage.

@pytest.fixture()
def populateList(f):
        assert 1 == 0

@pytest.mark.usefixtures(populateList)
def invokeFixture():
        pass
@pytest.fixture()
def populateList(f):
        assert 1 == 0

@pytest.mark.usefixtures("populateList")
def test_1():
        assert 0 == 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions