diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2021-11-04 15:31:26 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-11-08 20:19:21 +0100 |
| commit | 91acfc3514280370535f1dd6bebee57760bac7b9 (patch) | |
| tree | 7620a17204f1fb1cf8cc236d7d97652f56885bc5 /tests/test_runner_apps/failures | |
| parent | 1a5023883bf4c8cccb34a830edcc3c82aa862455 (diff) | |
Fixed #33264 -- Made test runner return non-zero error code for unexpected successes.
Diffstat (limited to 'tests/test_runner_apps/failures')
| -rw-r--r-- | tests/test_runner_apps/failures/__init__.py | 0 | ||||
| -rw-r--r-- | tests/test_runner_apps/failures/tests_failures.py | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_runner_apps/failures/__init__.py b/tests/test_runner_apps/failures/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/test_runner_apps/failures/__init__.py diff --git a/tests/test_runner_apps/failures/tests_failures.py b/tests/test_runner_apps/failures/tests_failures.py new file mode 100644 index 0000000000..0483fcd0f1 --- /dev/null +++ b/tests/test_runner_apps/failures/tests_failures.py @@ -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) |
