2014-03-13 15:49:37 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
def pytest_addoption(parser):
|
2014-03-15 14:55:59 +00:00
|
|
|
# Add option to skip meta (test suite-testing) tests.
|
|
|
|
parser.addoption('--skip-meta', action='store_true', help='skip test suite-testing tests')
|
|
|
|
# Add option to skip slow tests.
|
2014-03-13 15:49:37 +00:00
|
|
|
parser.addoption('--skip-slow', action='store_true', help='skip slow tests')
|
|
|
|
|
|
|
|
def pytest_runtest_setup(item):
|
2014-03-15 14:55:59 +00:00
|
|
|
if 'meta' in item.keywords and item.config.getoption('--skip-meta'):
|
|
|
|
pytest.skip('skipping meta test (--skip-meta given)')
|
2014-03-13 15:49:37 +00:00
|
|
|
if 'slow' in item.keywords and item.config.getoption('--skip-slow'):
|
|
|
|
pytest.skip('skipping slow test (--skip-slow given)')
|