Skip to content

Using @pytest.mark.skipif on a fixture silently fails. #964

Closed
@The-Compiler

Description

@The-Compiler

Since pytest.skip(...) can be used inside a fixture, I'd've expected that @pytest.mark.skipif does as well - turns out it seems to do nothing:

import pytest

@pytest.fixture
@pytest.mark.skipif(True, reason='test')
def fixt():
    pass

def test_one(fixt):
    pass

def test_two(fixt):
    pass
test_foo.py ..

============= 2 passed in 0.01 seconds ==============

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions