예제 #1
0
def _manager_setup():
    """Execute setup operations common to serial and parallel testing.

    This mostly means state cleanup, such as resetting database
    connections and clearing the shared state.
    """
    if TESTING_CONTEXT.get('manager_reset', False):
        return
    TESTING_CONTEXT['manager_reset'] = True
    state.update_constants()
    manager.reset()
예제 #2
0
def _manager_setup():
    """Execute setup operations common to serial and parallel testing.

    This mostly means state cleanup, such as resetting database
    connections and clearing the shared state.
    """
    if TESTING_CONTEXT.get("manager_reset", False):
        return
    TESTING_CONTEXT["manager_reset"] = True
    state.update_constants()
    manager.drain_messages()
예제 #3
0
def _manager_setup():
    """Execute setup operations common to serial and parallel testing.

    This mostly means state cleanup, such as resetting database
    connections and clearing the shared state.
    """
    for alias in db.connections:
        conn = db.connections[alias]
        conn.close()
        # Make very sure the connection is actually closed here, or the
        # same descriptor might be used in the processes we fork off in
        # the runner. In particular, the django_db_geventpool pools have
        # a closeall() method which isn't a no-op and actually shuts
        # down the pool.
        if hasattr(conn, 'closeall'):
            conn.closeall()
    state.update_constants()
    manager.reset()