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

Method applymarker

src/_pytest/fixtures.py:575–584  ·  src/_pytest/fixtures.py::FixtureRequest.applymarker

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: An object created by a call to ``pytest.mark.NAME(...)``.

(self, marker: str | MarkDecorator)

Source from the content-addressed store, hash-verified

573 raise NotImplementedError()
574
575 def applymarker(self, marker: str | MarkDecorator) -> None:
576 class="st">"""Apply a marker to a single test function invocation.
577
578 This method is useful if you don&class="cm">#x27;t want to have a keyword/marker
579 on all function invocations.
580
581 :param marker:
582 An object created by a call to ``pytest.mark.NAME(...)``.
583 class="st">"""
584 self.node.add_marker(marker)
585
586 def raiseerror(self, msg: str | None) -> NoReturn:
587 class="st">"""Raise a FixtureLookupError exception.

Callers 1

test_applymarkerMethod · 0.80

Calls 1

add_markerMethod · 0.80

Tested by 1

test_applymarkerMethod · 0.64