1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # 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):
profile.runctx('run_tests(*args, **kwargs)',
{'run_tests':run_tests,'args':args,'kwargs':kwargs},
{},
getattr(settings,'TEST_PROFILE',None)
)
# file: settings.py #
TEST_RUNNER = 'profiling.profile_tests'
TEST_PROFILE = None
|
More like this
- Unit Test Profiling for Django 1.3/1.4 by hoffmaje 1 year, 1 month ago
- Deep package test runner by eternicode 2 years, 2 months ago
- Unit Tests That Write Fixtures by justquick 4 years, 3 months ago
- UnitTesting without create/destroy database by crucialfelix 4 years, 3 months ago
- Continuous Integration command by berto 3 years, 7 months ago
Comments