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)[source]

Filters the discovered test cases

Parameters
  • test_ids (list) – The set of test_ids to be filtered

  • blacklist_file (str) – The path to a blacklist file

  • whitelist_file (str) – The path to a whitelist file

  • 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) –

Returns

iterable of strings. The strings are full test_ids

Return type

set

stestr.selection.filter_tests(filters, test_ids)[source]

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.