pytest - run tests with customized markers

1.1k Views Asked by At

I used customized pytest markers like below,

@pytest.mark.test_id("AB-1234")
def test_test1():
    pass

@pytest.mark.test_id("AB-1234")
def test_test2():
    pass

@pytest.mark.test_id("AB-5678")
def test_test3():
    pass

Here test_id is the marker name and "AB-1234" is the value. From command line how to run all the tests with marker test_id==AB-1234? I tried different variations with -m option but couldn't find a solution.

EDIT: I tried pytest -m "AB-1234" but it runs all the tests.

0

There are 0 best solutions below