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

Function normalize_mark_list

src/_pytest/mark/structures.py:464–478  ·  view source on GitHub ↗

Normalize an iterable of Mark or MarkDecorator objects into a list of marks by retrieving the `mark` attribute on MarkDecorator instances. :param mark_list: marks to normalize :returns: A new list of the extracted Mark objects

(
    mark_list: Iterable[Mark | MarkDecorator],
)

Source from the content-addressed store, hash-verified

462
463
464def normalize_mark_list(
465 mark_list: Iterable[Mark | MarkDecorator],
466) -> Iterable[Mark]:
467 """
468 Normalize an iterable of Mark or MarkDecorator objects into a list of marks
469 by retrieving the `mark` attribute on MarkDecorator instances.
470
471 :param mark_list: marks to normalize
472 :returns: A new list of the extracted Mark objects
473 """
474 for mark in mark_list:
475 mark_obj = getattr(mark, "mark", mark)
476 if not isinstance(mark_obj, Mark):
477 raise TypeError(f"got {mark_obj!r} instead of Mark")
478 yield mark_obj
479
480
481def store_mark(obj, mark: Mark) -> None:

Callers 2

setmultiMethod · 0.90
get_unpacked_marksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected