(pytester: Pytester)
| 890 | |
| 891 | |
| 892 | def test_no_teardown_if_setupclass_failed(pytester: Pytester) -> None: |
| 893 | testpath = pytester.makepyfile( |
| 894 | """ |
| 895 | import unittest |
| 896 | |
| 897 | class MyTestCase(unittest.TestCase): |
| 898 | x = 0 |
| 899 | |
| 900 | @classmethod |
| 901 | def setUpClass(cls): |
| 902 | cls.x = 1 |
| 903 | assert False |
| 904 | |
| 905 | def test_func1(self): |
| 906 | cls.x = 10 |
| 907 | |
| 908 | @classmethod |
| 909 | def tearDownClass(cls): |
| 910 | cls.x = 100 |
| 911 | |
| 912 | def test_notTornDown(): |
| 913 | assert MyTestCase.x == 1 |
| 914 | """ |
| 915 | ) |
| 916 | reprec = pytester.inline_run(testpath) |
| 917 | reprec.assertoutcome(passed=1, failed=1) |
| 918 | |
| 919 | |
| 920 | def test_cleanup_functions(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected