(self, pytester: Pytester)
| 852 | ) |
| 853 | |
| 854 | def test_parametrize_functional(self, pytester: Pytester) -> None: |
| 855 | pytester.makepyfile( |
| 856 | """ |
| 857 | import pytest |
| 858 | def pytest_generate_tests(metafunc): |
| 859 | metafunc.parametrize('x', [1,2], indirect=True) |
| 860 | metafunc.parametrize('y', [2]) |
| 861 | @pytest.fixture |
| 862 | def x(request): |
| 863 | return request.param * 10 |
| 864 | |
| 865 | def test_simple(x,y): |
| 866 | assert x in (10,20) |
| 867 | assert y == 2 |
| 868 | """ |
| 869 | ) |
| 870 | result = pytester.runpytest("-v") |
| 871 | result.stdout.fnmatch_lines( |
| 872 | ["*test_simple*1-2*", "*test_simple*2-2*", "*2 passed*"] |
| 873 | ) |
| 874 | |
| 875 | def test_parametrize_onearg(self) -> None: |
| 876 | metafunc = self.Metafunc(lambda x: None) |
nothing calls this directly
no test coverage detected