Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 16 lines (15 sloc) 0.511 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Source: http://www.djangosnippets.org/snippets/1315/
# file: profiling.py #
from django.test.simple import run_tests
from django.conf import settings
try:
    import cProfile as profile
except ImportError:
    import profile

def profile_tests(*args, **kwargs):
    settings.CELERY_ALWAYS_EAGER = True
    profile.runctx('run_tests(*args, **kwargs)',
                {'run_tests':run_tests,'args':args,'kwargs':kwargs},
                {},
                getattr(settings,'TEST_PROFILE',None)
            )
Something went wrong with that request. Please try again.