Esempio n. 1
0
    '    test_b',
    '    test_a',
    'Secondary',
    '  Gamma',
    '    test_c',
    '    test_b',
    '    test_a',
)


@pytest.mark.parametrize(
    'listing_obj,filter_obj,sorter_obj,expected_output',
    [
        # Basic name listing
        (
            listing.ExpandedNameLister(),
            filtering.Filter(),
            ordering.NoopSorter(),
            DEFAULT_NAME_OUTPUT,
        ),
        # Basic pattern listing
        (listing.ExpandedPatternLister(), filtering.Filter(),
         ordering.NoopSorter(), DEFAULT_PATTERN_OUTPUT),
        # Basic count listing
        (listing.CountLister(), filtering.Filter(), ordering.NoopSorter(),
         to_stdout(
             'Primary: (2 suites, 6 testcases)',
             'Secondary: (1 suite, 3 testcases)',
         )),
        # Custom sort & name listing
        (listing.ExpandedNameLister(), filtering.Filter(),
Esempio n. 2
0
    "    test_b",
    "    test_a",
    "Secondary",
    "  Gamma",
    "    test_c",
    "    test_b",
    "    test_a",
)


@pytest.mark.parametrize(
    "listing_obj,filter_obj,sorter_obj,expected_output",
    [
        # Basic name listing
        (
            listing.ExpandedNameLister(),
            filtering.Filter(),
            ordering.NoopSorter(),
            DEFAULT_NAME_OUTPUT,
        ),
        # Basic pattern listing
        (
            listing.ExpandedPatternLister(),
            filtering.Filter(),
            ordering.NoopSorter(),
            DEFAULT_PATTERN_OUTPUT,
        ),
        # Basic count listing
        (
            listing.CountLister(),
            filtering.Filter(),
# Default lister, lists by names
name_lister = listing.NameLister()

# Sample output:

# Primary
# ..Alpha
# ....test_a
# ....test_b
# ...

# Like NameLister, but does not trim testcases. May produce
# large output in case of parametrization

expanded_name_lister = listing.ExpandedNameLister()

# Pattern lister, lists tests in a format that is compatible with
# `--patterns` / `--tags` / `--tags-all` arguments
pattern_lister = listing.PatternLister()

# Sample output:

# Primary
# ..Primary:Alpha
# ....Primary:Alpha:test_a
# ....Primary:Alpha:test_b  --tags server
# ...

# Like Pattern lister, but does not trim testcases. May produce
# large output in case of parametrization