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

Method assert_markers

testing/test_mark.py:763–773  ·  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

761 reprec.assertoutcome(passed=1)
762
763 def assert_markers(self, items, **expected) -> None:
764 """Assert that given items have expected marker names applied to them.
765 expected should be a dict of (item name -> seq of expected marker names).
766
767 Note: this could be moved to ``pytester`` if proven to be useful
768 to other modules.
769 """
770 items = {x.name: x for x in items}
771 for name, expected_markers in expected.items():
772 markers = {m.name for m in items[name].iter_markers()}
773 assert markers == set(expected_markers)
774
775 @pytest.mark.filterwarnings("ignore")
776 def test_mark_from_parameters(self, pytester: Pytester) -> None:

Calls 1

iter_markersMethod · 0.80

Tested by

no test coverage detected