(self, pytester: Pytester)
| 80 | result.stdout.fnmatch_lines(["*3 passed*"]) |
| 81 | |
| 82 | def test_does_not_raise(self, pytester: Pytester) -> None: |
| 83 | pytester.makepyfile( |
| 84 | """ |
| 85 | from contextlib import contextmanager |
| 86 | import pytest |
| 87 | |
| 88 | @contextmanager |
| 89 | def does_not_raise(): |
| 90 | yield |
| 91 | |
| 92 | @pytest.mark.parametrize('example_input,expectation', [ |
| 93 | (3, does_not_raise()), |
| 94 | (2, does_not_raise()), |
| 95 | (1, does_not_raise()), |
| 96 | (0, pytest.raises(ZeroDivisionError)), |
| 97 | ]) |
| 98 | def test_division(example_input, expectation): |
| 99 | '''Test how much I know division.''' |
| 100 | with expectation: |
| 101 | assert (6 / example_input) is not None |
| 102 | """ |
| 103 | ) |
| 104 | result = pytester.runpytest() |
| 105 | result.stdout.fnmatch_lines(["*4 passed*"]) |
| 106 | |
| 107 | def test_does_not_raise_does_raise(self, pytester: Pytester) -> None: |
| 108 | pytester.makepyfile( |
nothing calls this directly
no test coverage detected