(pytester: Pytester)
| 308 | |
| 309 | |
| 310 | def test_setup_teardown_linking_issue265(pytester: Pytester) -> None: |
| 311 | # we accidentally didn't integrate nose setupstate with normal setupstate |
| 312 | # this test ensures that won't happen again |
| 313 | pytester.makepyfile( |
| 314 | ''' |
| 315 | import pytest |
| 316 | |
| 317 | class TestGeneric(object): |
| 318 | def test_nothing(self): |
| 319 | """Tests the API of the implementation (for generic and specialized).""" |
| 320 | |
| 321 | @pytest.mark.skipif("True", reason= |
| 322 | "Skip tests to check if teardown is skipped as well.") |
| 323 | class TestSkipTeardown(TestGeneric): |
| 324 | |
| 325 | def setup(self): |
| 326 | """Sets up my specialized implementation for $COOL_PLATFORM.""" |
| 327 | raise Exception("should not call setup for skipped tests") |
| 328 | |
| 329 | def teardown(self): |
| 330 | """Undoes the setup.""" |
| 331 | raise Exception("should not call teardown for skipped tests") |
| 332 | ''' |
| 333 | ) |
| 334 | reprec = pytester.runpytest() |
| 335 | reprec.assert_outcomes(passed=1, skipped=1) |
| 336 | |
| 337 | |
| 338 | def test_SkipTest_during_collection(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected