(pytester: Pytester, type: str)
| 351 | |
| 352 | @pytest.mark.parametrize("type", ["Error", "Failure"]) |
| 353 | def test_testcase_adderrorandfailure_defers(pytester: Pytester, type: str) -> None: |
| 354 | pytester.makepyfile( |
| 355 | """ |
| 356 | from unittest import TestCase |
| 357 | import pytest |
| 358 | class MyTestCase(TestCase): |
| 359 | def run(self, result): |
| 360 | excinfo = pytest.raises(ZeroDivisionError, lambda: 0/0) |
| 361 | try: |
| 362 | result.add%s(self, excinfo._excinfo) |
| 363 | except KeyboardInterrupt: |
| 364 | raise |
| 365 | except: |
| 366 | pytest.fail("add%s should not raise") |
| 367 | def test_hello(self): |
| 368 | pass |
| 369 | """ |
| 370 | % (type, type) |
| 371 | ) |
| 372 | result = pytester.runpytest() |
| 373 | result.stdout.no_fnmatch_line("*should not raise*") |
| 374 | |
| 375 | |
| 376 | @pytest.mark.parametrize("type", ["Error", "Failure"]) |
nothing calls this directly
no test coverage detected