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

Function _notin_text

src/_pytest/assertion/compare_text.py:89–104  ·  view source on GitHub ↗
(term: str, text: str, verbose: int = 0)

Source from the content-addressed store, hash-verified

87
88
89def _notin_text(term: str, text: str, verbose: int = 0) -> Iterator[str]:
90 index = text.find(term)
91 head = text[:index]
92 tail = text[index + len(term) :]
93 correct_text = head + tail
94 diff = _diff_text(text, correct_text, dummy_highlighter, verbose)
95 yield f"{saferepr(term, maxsize=42)} is contained here:"
96 for line in diff:
97 if line.startswith("Skipping"):
98 continue
99 if line.startswith("- "):
100 continue
101 if line.startswith("+ "):
102 yield " " + line[2:]
103 else:
104 yield line

Callers 1

assertrepr_compareFunction · 0.90

Calls 2

safereprFunction · 0.90
_diff_textFunction · 0.85

Tested by

no test coverage detected