(pytester: Pytester, mode)
| 37 | |
| 38 | |
| 39 | def test_show_different_scopes(pytester: Pytester, mode) -> None: |
| 40 | p = pytester.makepyfile( |
| 41 | ''' |
| 42 | import pytest |
| 43 | @pytest.fixture |
| 44 | def arg_function(): |
| 45 | """function scoped fixture""" |
| 46 | @pytest.fixture(scope='session') |
| 47 | def arg_session(): |
| 48 | """session scoped fixture""" |
| 49 | def test_arg1(arg_session, arg_function): |
| 50 | pass |
| 51 | ''' |
| 52 | ) |
| 53 | |
| 54 | result = pytester.runpytest(mode, p) |
| 55 | assert result.ret == 0 |
| 56 | |
| 57 | result.stdout.fnmatch_lines( |
| 58 | [ |
| 59 | "SETUP S arg_session*", |
| 60 | "*SETUP F arg_function*", |
| 61 | "*test_arg1 (fixtures used: arg_function, arg_session)*", |
| 62 | "*TEARDOWN F arg_function*", |
| 63 | "TEARDOWN S arg_session*", |
| 64 | ] |
| 65 | ) |
| 66 | |
| 67 | |
| 68 | def test_show_nested_fixtures(pytester: Pytester, mode) -> None: |
nothing calls this directly
no test coverage detected