Created
June 24, 2012 01:42
-
-
Save dokkaebi/2980960 to your computer and use it in GitHub Desktop.
fast failing Django test case
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
class FastFailingTest(TestCase): | |
""" | |
A TestCase that stops execution of the suite if it fails. | |
""" | |
def run(self, result=None): | |
if result is None: | |
result = self.defaultTestResult() | |
failfast = result.failfast | |
result.failfast = True | |
super(A_TestRunnerTest, self).run(result) | |
result.failfast = failfast |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment