@nottest
def _get_tests(fname, selector=None, nose_params=NOSE_COLLECT_PARAMS):
 output_file = os.path.join(ARTIFACT_DIR, fname)
 collect_with_output = (nose_params % output_file)
 if (selector is not None):
  cmd = ('%s %s -A "%s" w3af/' % (NOSETESTS, collect_with_output, selector))
 else:
  cmd = ('%s %s w3af/' % (NOSETESTS, collect_with_output))
 cmd_args = shlex.split(cmd)
 logging.debug(('Collecting tests: "%s"' % cmd))
 p = subprocess.Popen(cmd_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, universal_newlines=True)
 (stdout, stderr) = p.communicate()
 if (p.returncode != 0):
  logging.critical('Error while collecting tests!')
  logging.critical(stdout)
  logging.critical(stderr)
  sys.exit(1)
 (test_suite, test_result) = parse_xunit(output_file)
 normalize_test_names(test_suite)
 logging.debug(('Collected %s tests.' % test_result.testsRun))
 return test_suite

@ nottest def _get_tests ( fname , selector = None , nose_params = NOSE_COLLECT_PARAMS ) : output_file = os . path . join ( ARTIFACT_DIR , fname ) collect_with_output = ( nose_params % output_file ) if ( selector is not None ) : cmd = ( '%s %s -A "%s" w3af/' % ( NOSETESTS , collect_with_output , selector ) ) else : cmd = ( '%s %s w3af/' % ( NOSETESTS , collect_with_output ) ) cmd_args = shlex . split ( cmd ) logging . debug ( ( 'Collecting tests: "%s"' % cmd ) ) p = subprocess . Popen ( cmd_args , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE , shell = False , universal_newlines = True ) ( stdout , stderr ) = p . communicate ( ) if ( p . returncode != 0 ) : logging . critical ( 'Error while collecting tests!' ) logging . critical ( stdout ) logging . critical ( stderr ) sys . exit ( 1 ) ( test_suite , test_result ) = parse_xunit ( output_file ) normalize_test_names ( test_suite ) logging . debug ( ( 'Collected %s tests.' % test_result . testsRun ) ) return test_suite
collect tests and return them .