1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | from django.test import TestCase
class SimpleTest(TestCase):
''' Your unit tests go here '''
def test_a(self):
pass
def run(self, result=None):
if result is None: result = self.defaultTestResult()
try:
super(SimpleTest, self).run(result)
except KeyboardInterrupt:
result.stop()
|
More like this
- Super User Conditional Page Exception Reporting by zbyte64 3 years, 6 months ago
- Variable._resolve_lookup monkeypatch by showell 2 years, 2 months ago
- Query printer coroutine by fnl 2 years, 9 months ago
- A smart trace() command by aparajita 2 years, 7 months ago
- Capture Stack Trace Decorator by LorenDavie 1 year, 8 months ago
Comments
See also snippet 534 for how to make the unit tests always stop after the first failure.
#