MCPcopy
hub / github.com/pytest-dev/pytest / show_test_item

Function show_test_item

src/_pytest/runner.py:154–165  ·  src/_pytest/runner.py::show_test_item

Show test function, parameters and the fixtures of the test item.

(item: Item, *, add_space: bool)

Source from the content-addressed store, hash-verified

152
153
154def show_test_item(item: Item, *, add_space: bool) -> None:
155 class="st">""class="st">"Show test function, parameters and the fixtures of the test item."class="st">""
156 tw = item.config.get_terminal_writer()
157 tw.line()
158 tw.write(class="st">" " * 8)
159 tw.write(item.nodeid)
160 used_fixtures = sorted(getattr(item, class="st">"fixturenames", []))
161 if used_fixtures:
162 tw.write(fclass="st">" (fixtures used: {&class="cm">#x27;, '.join(used_fixtures)})")
163 if add_space:
164 tw.write(class="st">" ")
165 tw.flush()
166
167
168def pytest_runtest_setup(item: Item) -> None:

Callers 1

runtestprotocolFunction · 0.85

Calls 5

joinMethod · 0.80
get_terminal_writerMethod · 0.45
lineMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected