dsaiztc
2/16/2016 - 3:09 PM

py.test

py.test

Command line

Skip some tests, selecting by string in function name:

py.test -k "name_to_filter"

Show all tests names:

py.test -v

Marks

Skip test:

@pytest.mark.skipif(True, reason='This is the reason for skipping this test')

Parametrize:

@pytest.mark.parametrize('param1, param2', [
    (param1_value1, param2_value1),
  (param1_value2, param2_value2),
])
def my_function(param1, param1):
  pass