def find_skips_in_file(path):
 BUG_RE = re.compile('\\s*@.*skip_because\\(bug=[\\\'"](\\d+)[\\\'"]')
 DEF_RE = re.compile('\\s*def (\\w+)\\(')
 bug_found = False
 results = []
 with open(path, 'rb') as content:
  lines = content.readlines()
  for (x, line) in enumerate(lines):
   if (not bug_found):
    res = BUG_RE.match(line)
    if res:
     bug_no = int(res.group(1))
     debug('Found bug skip %s on line %d', bug_no, (x + 1))
     bug_found = True
   else:
    res = DEF_RE.match(line)
    if res:
     method = res.group(1)
     debug('Found test method %s skips for bug %d', method, bug_no)
     results.append((method, bug_no))
     bug_found = False
 return results

def find_skips_in_file ( path ) : BUG_RE = re . compile ( '\\s*@.*skip_because\\(bug=[\\\'"](\\d+)[\\\'"]' ) DEF_RE = re . compile ( '\\s*def (\\w+)\\(' ) bug_found = False results = [ ] with open ( path , 'rb' ) as content : lines = content . readlines ( ) for ( x , line ) in enumerate ( lines ) : if ( not bug_found ) : res = BUG_RE . match ( line ) if res : bug_no = int ( res . group ( 1 ) ) debug ( 'Found bug skip %s on line %d' , bug_no , ( x + 1 ) ) bug_found = True else : res = DEF_RE . match ( line ) if res : method = res . group ( 1 ) debug ( 'Found test method %s skips for bug %d' , method , bug_no ) results . append ( ( method , bug_no ) ) bug_found = False return results
return the skip tuples in a test file .