1
0
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:
Baptiste Mispelon
2021-11-04 15:31:26 +01:00
committed by Mariusz Felisiak
parent 1a5023883b
commit 91acfc3514
6 changed files with 51 additions and 2 deletions

View 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)