mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #33264 -- Made test runner return non-zero error code for unexpected successes.
This commit is contained in:
committed by
Mariusz Felisiak
parent
1a5023883b
commit
91acfc3514
23
tests/test_runner_apps/failures/tests_failures.py
Normal file
23
tests/test_runner_apps/failures/tests_failures.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from unittest import TestCase, expectedFailure
|
||||
|
||||
|
||||
class FailureTestCase(TestCase):
|
||||
def test_sample(self):
|
||||
self.assertEqual(0, 1)
|
||||
|
||||
|
||||
class ErrorTestCase(TestCase):
|
||||
def test_sample(self):
|
||||
raise Exception('test')
|
||||
|
||||
|
||||
class ExpectedFailureTestCase(TestCase):
|
||||
@expectedFailure
|
||||
def test_sample(self):
|
||||
self.assertEqual(0, 1)
|
||||
|
||||
|
||||
class UnexpectedSuccessTestCase(TestCase):
|
||||
@expectedFailure
|
||||
def test_sample(self):
|
||||
self.assertEqual(1, 1)
|
||||
Reference in New Issue
Block a user