(pytester: Pytester)
| 864 | |
| 865 | |
| 866 | def test_non_unittest_no_setupclass_support(pytester: Pytester) -> None: |
| 867 | testpath = pytester.makepyfile( |
| 868 | """ |
| 869 | class TestFoo(object): |
| 870 | x = 0 |
| 871 | |
| 872 | @classmethod |
| 873 | def setUpClass(cls): |
| 874 | cls.x = 1 |
| 875 | |
| 876 | def test_method1(self): |
| 877 | assert self.x == 0 |
| 878 | |
| 879 | @classmethod |
| 880 | def tearDownClass(cls): |
| 881 | cls.x = 1 |
| 882 | |
| 883 | def test_not_teareddown(): |
| 884 | assert TestFoo.x == 0 |
| 885 | |
| 886 | """ |
| 887 | ) |
| 888 | reprec = pytester.inline_run(testpath) |
| 889 | reprec.assertoutcome(passed=2) |
| 890 | |
| 891 | |
| 892 | def test_no_teardown_if_setupclass_failed(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected