# Test Selection Module

This module is used to deal with anything related to test selection in stestr.

stestr.selection.construct_list(test_ids, blacklist_file=None, whitelist_file=None, regexes=None, black_regex=None, exclude_list=None, include_list=None, exclude_regex=None)

  Filters the discovered test cases

  Parameters

    - test_ids (list) – The set of test_ids to be filtered

    - blacklist_file (str) – Soon to be replaced by exclude_list

    - whitelist_file (str) – Soon to be replaced by include_list

    - regexes (list) – A list of regex filters to apply to the test_ids. The output will contain any test_ids which have a re.search() match for any of the regexes in this list. If this is None all test_ids will be returned

    - black_regex (str) – Soon to be replaced by exclude_regex

    - exclude_list (str) – The path to an exclusion_list file

    - include_list (str) – The path to an inclusion_list file

    - exclude_regex (str) – regex pattern to exclude tests

  Returns

    iterable of strings. The strings are full test_ids

  Return type

    set

stestr.selection.filter_tests(filters, test_ids)

  Filter test_ids by the test_filters.

  Parameters

    - filters (list) – A list of regex filters to apply to the test_ids. The output will contain any test_ids which have a re.search() match for any of the regexes in this list. If this is None all test_ids will be returned

    - test_ids (list) – A list of test_ids that will be filtered

  Returns

    A list of test ids.