由 neevop 七月 3, 2023
define allowable markers
# in pytest.ini
[pytest]
markers =
markers_1: description 1
markers_2: description 2
# usage
@pytest.mark.marker_name
def test_name():
pass
marker - skip
@pytest.mark.skip('comment')
def test_name():
pass
use marker
# except marker
pytest tests/ -m "not marker_name"
# list all marker
pytest tests/ -m "webtest"