def test_help_commands_equally_functional(script):
 results = list(map(script.pip, ('help', '--help')))
 results.append(script.pip())
 out = map((lambda x: x.stdout), results)
 ret = map((lambda x: x.returncode), results)
 msg = '"pip --help" != "pip help" != "pip"'
 assert (len(set(out)) == 1), ('output of: ' + msg)
 assert (sum(ret) == 0), ('exit codes of: ' + msg)
 for (name, cls) in commands.items():
  if cls.hidden:
   continue
  assert (script.pip('help', name).stdout == script.pip(name, '--help').stdout)

def test_help_commands_equally_functional ( script ) : results = list ( map ( script . pip , ( 'help' , '--help' ) ) ) results . append ( script . pip ( ) ) out = map ( ( lambda x : x . stdout ) , results ) ret = map ( ( lambda x : x . returncode ) , results ) msg = '"pip --help" != "pip help" != "pip"' assert ( len ( set ( out ) ) == 1 ) , ( 'output of: ' + msg ) assert ( sum ( ret ) == 0 ) , ( 'exit codes of: ' + msg ) for ( name , cls ) in commands . items ( ) : if cls . hidden : continue assert ( script . pip ( 'help' , name ) . stdout == script . pip ( name , '--help' ) . stdout )
test if pip help and pip --help behave the same way .