Created
June 12, 2010 01:23
-
-
Save rctay/435278 to your computer and use it in GitHub Desktop.
[django] traceback on Ctrl-C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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