MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_show_only_active_fixtures

Function test_show_only_active_fixtures

testing/test_setuponly.py:13–36  ·  view source on GitHub ↗
(
    pytester: Pytester, mode, dummy_yaml_custom_test
)

Source from the content-addressed store, hash-verified

11
12
13def test_show_only_active_fixtures(
14 pytester: Pytester, mode, dummy_yaml_custom_test
15) -> None:
16 pytester.makepyfile(
17 '''
18 import pytest
19 @pytest.fixture
20 def _arg0():
21 """hidden arg0 fixture"""
22 @pytest.fixture
23 def arg1():
24 """arg1 docstring"""
25 def test_arg1(arg1):
26 pass
27 '''
28 )
29
30 result = pytester.runpytest(mode)
31 assert result.ret == 0
32
33 result.stdout.fnmatch_lines(
34 ["*SETUP F arg1*", "*test_arg1 (fixtures used: arg1)*", "*TEARDOWN F arg1*"]
35 )
36 result.stdout.no_fnmatch_line("*_arg0*")
37
38
39def test_show_different_scopes(pytester: Pytester, mode) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
no_fnmatch_lineMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected