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

Function get_assertion_text_diff_style

src/_pytest/assertion/util.py:50–61  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

48
49
50def get_assertion_text_diff_style(config: Config) -> _AssertionTextDiffStyle:
51 style = str(config.getini(ASSERTION_TEXT_DIFF_STYLE_INI))
52 match style:
53 case "ndiff" | "block":
54 return style
55 case _:
56 choices = ", ".join(
57 repr(choice) for choice in ASSERTION_TEXT_DIFF_STYLE_CHOICES
58 )
59 raise UsageError(
60 f"{ASSERTION_TEXT_DIFF_STYLE_INI} must be one of {choices}; got {style!r}"
61 )
62
63
64def validate_assertion_text_diff_style(config: Config) -> None:

Callers 1

Calls 3

UsageErrorClass · 0.90
joinMethod · 0.80
getiniMethod · 0.45

Tested by

no test coverage detected