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

Method assert_markers

testing/test_mark.py:694–704  ·  view source on GitHub ↗

Assert that given items have expected marker names applied to them. expected should be a dict of (item name -> seq of expected marker names). Note: this could be moved to ``pytester`` if proven to be useful to other modules.

(self, items, **expected)

Source from the content-addressed store, hash-verified

692 reprec.assertoutcome(passed=1)
693
694 def assert_markers(self, items, **expected) -> None:
695 """Assert that given items have expected marker names applied to them.
696 expected should be a dict of (item name -> seq of expected marker names).
697
698 Note: this could be moved to ``pytester`` if proven to be useful
699 to other modules.
700 """
701 items = {x.name: x for x in items}
702 for name, expected_markers in expected.items():
703 markers = {m.name for m in items[name].iter_markers()}
704 assert markers == set(expected_markers)
705
706 @pytest.mark.filterwarnings("ignore")
707 def test_mark_from_parameters(self, pytester: Pytester) -> None:

Calls 1

iter_markersMethod · 0.80

Tested by

no test coverage detected