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
- Exclude Apps When Testing by cronosa 2 years, 8 months ago
- Variable._resolve_lookup monkeypatch by showell 3 years, 7 months ago
- UnitTesting without create/destroy database by crucialfelix 4 years, 4 months ago
- Stop tests at the first failure by akaihola 5 years, 5 months ago
- Testing for failure in management commands by David 2 years, 10 months ago
Comments
See also snippet 534 for how to make the unit tests always stop after the first failure.
#