#NEWLINE# def get_tests_by_prefix( prefix , session = None , limit = 100 , offset = 0 ) : #NEWLINE# #INDENT# "Returns all tests with the given prefix in the DB.\n\n    A test prefix is the first segment of a test_id when split using a period\n    ('.'). This function will return a list of tests whose first\n    period-separated token ends with the specified prefix. As a side-effect,\n    given an input 'a', this will return tests with prefixes 'a', but also\n    prefixes wrapped in function syntax, such as 'setUpClass (a'.\n\n    Note that this implementation assumes that tests ids are semantically\n    separated by a period. If no period character exists in a test id, its\n    prefix will be considered the full test id, and this method may return\n    unexpected results.\n\n    :param str prefix: the test prefix to search for\n    :param session: optional session object: if one isn't provided, a new\n                    session will be acquired for the duration of this operation\n    :param int limit: the maximum number of results to return\n    :param int offset: the starting index, for pagination purposes\n    :return list: the list of matching test objects, ordered by their test id\n    :rtype: subunit2sql.models.Test\n    " #NEWLINE# session = ( session or get_session ( ) ) #NEWLINE# backend = session . bind . dialect . name #NEWLINE# if ( backend == 'mysql' ) : #NEWLINE# #INDENT# return _get_tests_by_prefix_mysql ( prefix , session , limit , offset ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return _get_tests_by_prefix_other ( prefix , session , limit , offset )