(pytester: Pytester)
| 8 | |
| 9 | |
| 10 | def test_fixtures_in_module(pytester: Pytester) -> None: |
| 11 | p = pytester.makepyfile( |
| 12 | ''' |
| 13 | import pytest |
| 14 | @pytest.fixture |
| 15 | def _arg0(): |
| 16 | """hidden arg0 fixture""" |
| 17 | @pytest.fixture |
| 18 | def arg1(): |
| 19 | """arg1 docstring""" |
| 20 | def test_arg1(arg1): |
| 21 | pass |
| 22 | ''' |
| 23 | ) |
| 24 | |
| 25 | result = pytester.runpytest("--fixtures-per-test", p) |
| 26 | assert result.ret == 0 |
| 27 | |
| 28 | result.stdout.fnmatch_lines( |
| 29 | [ |
| 30 | "*fixtures used by test_arg1*", |
| 31 | "*(test_fixtures_in_module.py:9)*", |
| 32 | "arg1 -- test_fixtures_in_module.py:6", |
| 33 | " arg1 docstring", |
| 34 | ] |
| 35 | ) |
| 36 | result.stdout.no_fnmatch_line("*_arg0*") |
| 37 | |
| 38 | |
| 39 | def test_fixtures_in_conftest(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected