From aed06d038660d8dcf709c7d8fb8307b9749984eb Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 21 Apr 2022 08:54:59 -0300 Subject: [PATCH] Show test names in bold --- src/_pytest/terminal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 8336a0401..41a9861a3 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -1265,7 +1265,12 @@ class TerminalReporter: def _get_node_id_with_markup(tw: TerminalWriter, config: Config, rep: BaseReport): nodeid = config.cwd_relative_nodeid(rep.nodeid) - return nodeid + path, *parts = nodeid.split("::") + if parts: + parts_markup = tw.markup("::".join(parts), bold=True) + return path + "::" + parts_markup + else: + return path def _format_trimmed(format: str, msg: str, available_width: int) -> Optional[str]: