コード例 #1
0
@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(),
         ordering.AlphanumericSorter(),
         to_stdout(
             'Primary',
             '  Alpha',
             '    test_a',
             '    test_b',
             '    test_c',
             '  Beta',
             '    test_a',
コード例 #2
0
 (
     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(),
     ordering.AlphanumericSorter(),
     to_stdout(
         "Primary",
         "  Alpha",
コード例 #3
0
# 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

expanded_pattern_lister = listing.ExpandedPatternLister()

# Count lister, just lists top level test instances with the number of
# suites & testcases.

count_lister = listing.CountLister()

# Sample output:

# Primary: (2 suites, 6 testcases)
# Secondary: (1 suite, 102 testcases)

# Here is a list of filters, you can pass them to
# the test plan declaration below and see how they change the
# test listing output.

pattern_filter_1 = filtering.Pattern('Primary')
pattern_filter_2 = filtering.Pattern('*:*:test_c')

tag_filter_1 = filtering.Tags('client')
tag_filter_2 = filtering.Tags({'color': 'blue'})