How to use the betelgeuse.collector.collect_tests function in Betelgeuse

To help you get started, we’ve selected a few Betelgeuse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SatelliteQE / betelgeuse / tests / test_collector.py View on Github external
def test_collect_ignore_path(ignore_path):
    """Check if ``collect_tests`` don't collect tests on the ignore paths."""
    tests = collector.collect_tests('tests/data', [ignore_path])
    assert 'tests/data/ignore_dir/test_ignore_dir.py' not in tests
    assert 'tests/data/test_sample.py' in tests
    assert len(tests['tests/data/test_sample.py']) == 4
github SatelliteQE / betelgeuse / betelgeuse / __init__.py View on Github external
element.set('value', response_property[1])
        response_properties.append(element)
        testcases.append(response_properties)
    properties = ElementTree.Element('properties')
    properties.append(create_xml_property(
        'dry-run', 'true' if dry_run else 'false'))
    properties.append(create_xml_property(
        'lookup-method', lookup_method))
    if lookup_method == 'custom':
        properties.append(create_xml_property(
            'polarion-custom-lookup-method-field-id',
            lookup_method_custom_field_id
        ))
    testcases.append(properties)

    source_testcases = itertools.chain(*collector.collect_tests(
        source_code_path, collect_ignore_path).values())
    for testcase in source_testcases:
        testcases.append(
            create_xml_testcase(config, testcase, automation_script_format))

    et = ElementTree.ElementTree(testcases)
    et.write(output_path, encoding='utf-8', xml_declaration=True)