(self, pytester: Pytester)
| 105 | result.stdout.fnmatch_lines(["*4 passed*"]) |
| 106 | |
| 107 | def test_does_not_raise_does_raise(self, pytester: Pytester) -> None: |
| 108 | pytester.makepyfile( |
| 109 | """ |
| 110 | from contextlib import contextmanager |
| 111 | import pytest |
| 112 | |
| 113 | @contextmanager |
| 114 | def does_not_raise(): |
| 115 | yield |
| 116 | |
| 117 | @pytest.mark.parametrize('example_input,expectation', [ |
| 118 | (0, does_not_raise()), |
| 119 | (1, pytest.raises(ZeroDivisionError)), |
| 120 | ]) |
| 121 | def test_division(example_input, expectation): |
| 122 | '''Test how much I know division.''' |
| 123 | with expectation: |
| 124 | assert (6 / example_input) is not None |
| 125 | """ |
| 126 | ) |
| 127 | result = pytester.runpytest() |
| 128 | result.stdout.fnmatch_lines(["*2 failed*"]) |
| 129 | |
| 130 | def test_noclass(self) -> None: |
| 131 | with pytest.raises(TypeError): |
nothing calls this directly
no test coverage detected