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

Function pytest_assertrepr_compare

src/_pytest/assertion/__init__.py:218–236  ·  view source on GitHub ↗
(
    config: Config, op: str, left: Any, right: Any
)

Source from the content-addressed store, hash-verified

216
217
218def pytest_assertrepr_compare(
219 config: Config, op: str, left: Any, right: Any
220) -> list[str] | None:
221 if config.pluginmanager.has_plugin("terminalreporter"):
222 highlighter = config.get_terminal_writer()._highlight
223 else:
224 # Keep it plaintext when not using terminalrepoterer (#14377).
225 highlighter = util.dummy_highlighter
226 explanation = list(
227 util.assertrepr_compare(
228 op=op,
229 left=left,
230 right=right,
231 verbose=config.get_verbosity(Config.VERBOSITY_ASSERTIONS),
232 highlighter=highlighter,
233 assertion_text_diff_style=util.get_assertion_text_diff_style(config),
234 )
235 )
236 return explanation or None

Callers

nothing calls this directly

Calls 3

has_pluginMethod · 0.80
get_terminal_writerMethod · 0.45
get_verbosityMethod · 0.45

Tested by

no test coverage detected