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

Method applymarker

src/_pytest/fixtures.py:557–567  ·  view source on GitHub ↗

Apply a marker to a single test function invocation. This method is useful if you don't want to have a keyword/marker on all function invocations. :param marker: A :class:`pytest.MarkDecorator` object created by a call to ``pytest.mark.NAME(...)``.

(self, marker: Union[str, MarkDecorator])

Source from the content-addressed store, hash-verified

555 node.addfinalizer(finalizer)
556
557 def applymarker(self, marker: Union[str, MarkDecorator]) -> None:
558 """Apply a marker to a single test function invocation.
559
560 This method is useful if you don't want to have a keyword/marker
561 on all function invocations.
562
563 :param marker:
564 A :class:`pytest.MarkDecorator` object created by a call
565 to ``pytest.mark.NAME(...)``.
566 """
567 self.node.add_marker(marker)
568
569 def raiseerror(self, msg: Optional[str]) -> "NoReturn":
570 """Raise a FixtureLookupError with the given message."""

Callers 1

test_applymarkerMethod · 0.95

Calls 1

add_markerMethod · 0.80

Tested by 1

test_applymarkerMethod · 0.76