def pytest_collection_modifyitems(config, items): if not config.getoption('--fast'): # --fast not given, run all the tests return slow_tests = ['db', 'network', 'maybeslow'] skip_as_slow = pytest.mark.skip( reason='skipped slow test [--fast command line option given]') for item in items: if any(x in item.keywords for x in slow_tests): item.add_marker(skip_as_slow)
def pytest_collection_modifyitems(config, items): if not config.getoption('--fast'): # --fast not given, run all the tests return slow_tests = ['db', 'network', 'maybeslow'] skip_as_slow = pytest.mark.skip( reason='skipped slow test [--fast command line option given]' ) for item in items: if any(x in item.keywords for x in slow_tests): item.add_marker(skip_as_slow)