testing/unexpected_passes_common/data_types.py
def FilterOutUnusedExpectations(self):
    """Filters out any unused Expectations from stored data.

    An Expectation is considered unused if its corresponding dictionary is
    empty. If removing Expectations results in a top-level test key having an
    empty dictionary, that test entry will also be removed.

    Returns:
      A dict from expectation file name (str) to set of unused expectations
      (str) from that file.
    """
    logging.info('Filtering out unused expectations')
    unused = collections.defaultdict(list)
    unused_count = 0
    for (expectation_file, expectation,
         builder_map) in self.IterBuilderStepMaps():
      if not builder_map:
        unused[expectation_file].append(expectation)
        unused_count += 1
    for expectation_file, expectations in unused.items():
      for e in expectations:
        del self[expectation_file][e]
    logging.debug('Found %d unused expectations', unused_count)

    empty_files = []
    for expectation_file, expectation_map in self.items():
      if not expectation_map:
        empty_files.append(expectation_file)
    for empty in empty_files:
      del self[empty]
    logging.debug('Found %d empty files: %s', len(empty_files), empty_files)

    return unused
Filters out any unused Expectations from stored data.

    An Expectation is considered unused if its corresponding dictionary is
    empty. If removing Expectations results in a top-level test key having an
    empty dictionary, that test entry will also be removed.

    Returns:
      A dict from expectation file name (str) to set of unused expectations
      (str) from that file.
    
Filters out any unused Expectations from stored data.
An Expectation is considered unused if its corresponding dictionary is
empty. If removing Expectations results in a top-level test key having an
empty dictionary, that test entry will also be removed.
Filters out any unused Expectations from stored data . An Expectation is considered unused if its corresponding dictionary is empty . If removing Expectations results in a top - level test key having an empty dictionary that test entry will also be removed .
def FilterOutUnusedExpectations(self):
    logging.info('Filtering out unused expectations')
    unused = collections.defaultdict(list)
    unused_count = 0
    for (expectation_file, expectation,
         builder_map) in self.IterBuilderStepMaps():
      if not builder_map:
        unused[expectation_file].append(expectation)
        unused_count += 1
    for expectation_file, expectations in unused.items():
      for e in expectations:
        del self[expectation_file][e]
    logging.debug('Found %d unused expectations', unused_count)
    empty_files = []
    for expectation_file, expectation_map in self.items():
      if not expectation_map:
        empty_files.append(expectation_file)
    for empty in empty_files:
      del self[empty]
    logging.debug('Found %d empty files: %s', len(empty_files), empty_files)
    return unused
def FilterOutUnusedExpectations ( self ) : logging . info ( 'Filtering out unused expectations' ) unused = collections . defaultdict ( list ) unused_count = 0 for ( expectation_file , expectation , builder_map ) in self . IterBuilderStepMaps ( ) : if not builder_map : unused [ expectation_file ] . append ( expectation ) unused_count += 1 for expectation_file , expectations in unused . items ( ) : for e in expectations : del self [ expectation_file ] [ e ] logging . debug ( 'Found %d unused expectations' , unused_count ) empty_files = [ ] for expectation_file , expectation_map in self . items ( ) : if not expectation_map : empty_files . append ( expectation_file ) for empty in empty_files : del self [ empty ] logging . debug ( 'Found %d empty files: %s' , len ( empty_files ) , empty_files ) return unused
Filters out any unused Expectations from stored data.
Filters out any unused Expectations from stored data .
"""Filters out any unused Expectations from stored data.

    An Expectation is considered unused if its corresponding dictionary is
    empty. If removing Expectations results in a top-level test key having an
    empty dictionary, that test entry will also be removed.

    Returns:
      A dict from expectation file name (str) to set of unused expectations
      (str) from that file.
    """
A dict from expectation file name (str) to set of unused expectations
(str) from that file.
A dict from expectation file name ( str ) to set of unused expectations ( str ) from that file .
self