parameters: (argv=None)
return_statement: return False
docstring: Return True if running django or py.test unit tests.
docstring_summary: Return True if running django or py.test unit tests.
docstring_tokens: Return True if running django or py . test unit tests .
function: def is_testing(argv=None):
      import sys
  
      '''Return True if running django or py.test unit tests.'''
      if 'PYTEST_CURRENT_TEST' in os.environ.keys():
          return True
      argv = sys.argv if argv is None else argv
      if len(argv) >= 1 and ('py.test' in argv[0] or 'py/test.py' in argv[0]):
          return True
      elif len(argv) >= 2 and argv[1] == 'test':
          return True
      return False
function_tokens: def is_testing ( argv = None ) : import sys if 'PYTEST_CURRENT_TEST' in os . environ . keys ( ) : return True argv = sys . argv if argv is None else argv if len ( argv ) >= 1 and ( 'py.test' in argv [ 0 ] or 'py/test.py' in argv [ 0 ] ) : return True elif len ( argv ) >= 2 and argv [ 1 ] == 'test' : return True return False