lundi 4 mai 2020

Mark test as passed from inside a fixture in pytest

With pytest.skip or pytest.xfail, I can mark a test as skipped or xfailed from inside the fixture. There is no pytest.pass, though. How can I mark it as passed?

import pytest

@pytest.fixture
def fixture():
    #pytest.skip()
    pytest.xfail()

def test(fixture):
    assert False

Aucun commentaire:

Enregistrer un commentaire