(
fixturedef: FixtureDef[object], config: Config, msg: str
)
| 62 | |
| 63 | |
| 64 | def _show_fixture_action( |
| 65 | fixturedef: FixtureDef[object], config: Config, msg: str |
| 66 | ) -> None: |
| 67 | capman = config.pluginmanager.getplugin("capturemanager") |
| 68 | if capman: |
| 69 | capman.suspend_global_capture() |
| 70 | |
| 71 | tw = config.get_terminal_writer() |
| 72 | tw.line() |
| 73 | # Use smaller indentation the higher the scope: Session = 0, Package = 1, etc. |
| 74 | scope_indent = list(reversed(Scope)).index(fixturedef._scope) |
| 75 | tw.write(" " * 2 * scope_indent) |
| 76 | |
| 77 | scopename = fixturedef.scope[0].upper() |
| 78 | tw.write(f"{msg:<8} {scopename} {fixturedef.argname}") |
| 79 | |
| 80 | if msg == "SETUP": |
| 81 | deps = sorted(arg for arg in fixturedef.argnames if arg != "request") |
| 82 | if deps: |
| 83 | tw.write(" (fixtures used: {})".format(", ".join(deps))) |
| 84 | |
| 85 | if hasattr(fixturedef, "cached_param"): |
| 86 | tw.write(f"[{saferepr(fixturedef.cached_param, maxsize=42)}]") |
| 87 | |
| 88 | tw.flush() |
| 89 | |
| 90 | if capman: |
| 91 | capman.resume_global_capture() |
| 92 | |
| 93 | |
| 94 | @pytest.hookimpl(tryfirst=True) |
no test coverage detected