MCPcopy Create free account
hub / github.com/pytest-dev/pytest / _notin_text

Function _notin_text

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

Source from the content-addressed store, hash-verified

474
475
476def _notin_text(term: str, text: str, verbose: int = 0) -> List[str]:
477 index = text.find(term)
478 head = text[:index]
479 tail = text[index + len(term) :]
480 correct_text = head + tail
481 diff = _diff_text(text, correct_text, verbose)
482 newdiff = ["%s is contained here:" % saferepr(term, maxsize=42)]
483 for line in diff:
484 if line.startswith("Skipping"):
485 continue
486 if line.startswith("- "):
487 continue
488 if line.startswith("+ "):
489 newdiff.append(" " + line[2:])
490 else:
491 newdiff.append(line)
492 return newdiff
493
494
495def running_on_ci() -> bool:

Callers 1

assertrepr_compareFunction · 0.85

Calls 3

safereprFunction · 0.90
_diff_textFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected