(argv=None)
return False
Return True if running django or py.test unit tests.
Return True if running django or py.test unit tests.
Return True if running django or py . test unit tests .
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
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