(pytester: Pytester)
| 327 | |
| 328 | |
| 329 | def test_setup_class(pytester: Pytester) -> None: |
| 330 | testpath = pytester.makepyfile( |
| 331 | """ |
| 332 | import unittest |
| 333 | import pytest |
| 334 | class MyTestCase(unittest.TestCase): |
| 335 | x = 0 |
| 336 | def setup_class(cls): |
| 337 | cls.x += 1 |
| 338 | def test_func1(self): |
| 339 | assert self.x == 1 |
| 340 | def test_func2(self): |
| 341 | assert self.x == 1 |
| 342 | def teardown_class(cls): |
| 343 | cls.x -= 1 |
| 344 | def test_teareddown(): |
| 345 | assert MyTestCase.x == 0 |
| 346 | """ |
| 347 | ) |
| 348 | reprec = pytester.inline_run(testpath) |
| 349 | reprec.assertoutcome(passed=3) |
| 350 | |
| 351 | |
| 352 | @pytest.mark.parametrize("type", ["Error", "Failure"]) |
nothing calls this directly
no test coverage detected