Skip to content

Instantly share code, notes, and snippets.

@rctay
Created June 12, 2010 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rctay/435278 to your computer and use it in GitHub Desktop.
Save rctay/435278 to your computer and use it in GitHub Desktop.
[django] traceback on Ctrl-C
"""
In django 1.2 (ie. after revision #12034), pressing Ctrl-C on a test run no
longer gave a convulted traceback.
However, sometimes it may be desirable to get this traceback - for example, for
profiling reasons; see
http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux/378024#378024
"""
from django.test.simple import DjangoTestRunner, DjangoTestSuiteRunner
class Runner(DjangoTestRunner):
def run(self, *args, **kwargs):
return super(DjangoTestRunner, self).run(*args, **kwargs)
class SuiteRunner(DjangoTestSuiteRunner):
def run_suite(self, suite, **kwargs):
return Runner(verbosity=self.verbosity, failfast=self.failfast).run(suite)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment