MCPcopy Index your code
hub / github.com/python/mypy / TestItem

Class TestItem

mypy/test/data.py:437–456  ·  view source on GitHub ↗

Parsed test caseitem. An item is of the form [id arg] .. data ..

Source from the content-addressed store, hash-verified

435
436@dataclass
437class TestItem:
438 """Parsed test caseitem.
439
440 An item is of the form
441 [id arg]
442 .. data ..
443 """
444
445 id: str
446 arg: str | None
447 # Processed, collapsed text data
448 data: list[str]
449 # Start line: 1-based, inclusive, relative to testcase
450 line: int
451 # End line: 1-based, exclusive, relative to testcase; not same as `line + len(test_item.data)` due to collapsing
452 end_line: int
453
454 @property
455 def trimmed_newlines(self) -> int: # compensates for strip_list
456 return self.end_line - self.line - len(self.data)
457
458
459def parse_test_data(raw_data: str, name: str) -> list[TestItem]:

Callers 1

parse_test_dataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…