'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 ``testdir`` if proven to be useful
to other modules.'

def assert_markers(self, items, **expected):

    from _pytest.mark import MarkInfo
    items = dict(((x.name, x) for x in items))
    for (name, expected_markers) in expected.items():
        markers = items[name].keywords._markers
        marker_names = set([name for (name, v) in markers.items() if isinstance(v, MarkInfo)])
        assert (marker_names == set(expected_markers))
