Skip to content

staticmethod tests fail when declared in a superclass #3466

Closed
@radzak

Description

@radzak

staticmethod test fails if you declare it in a superclass:

@pytest.fixture
def fixture():
    return True

class TestFoo:
    @staticmethod
    def test_me(fixture):
        assert fixture

class TestBar(TestFoo):
    ...

TestBar.test_me fails due to the TypeError: test_me() missing 1 required positional argument: 'fixture'.

TestFoo.test_me passes correctly.

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