Код: Выделить всё
import pytest
@pytest.mark.skip
def test1():
assert True
@pytest.mark.xfail
def test2():
assert True
Код: Выделить всё
$ pytest
=================== test session starts ===================
platform win32 -- Python 3.9.13, pytest-7.4.0, pluggy-1.2.0
django: settings: core.settings (from ini)
rootdir: C:\Users\kai\test-django-project2
configfile: pytest.ini
plugins: django-4.5.2
collected 2 items
tests\test_store.py sX [100%]
============== 1 skipped, 1 xpassed in 0.10s ==============
Код: Выделить всё
import pytest
@pytest.mark.skip
def test1():
assert False
@pytest.mark.xfail
def test2():
assert False
Код: Выделить всё
$ pytest
=================== test session starts ===================
platform win32 -- Python 3.9.13, pytest-7.4.0, pluggy-1.2.0
django: settings: core.settings (from ini)
rootdir: C:\Users\kai\test-django-project2
configfile: pytest.ini
plugins: django-4.5.2
collected 2 items
tests\test_store.py sx [100%]
============== 1 skipped, 1 xfailed in 0.24s ==============
Подробнее здесь: https://stackoverflow.com/questions/768 ... -in-pytest