def _warn_incompatibility_with_xunit2(request, fixture_name):
    """Emits a PytestWarning about the given fixture being incompatible with newer xunit revisions"""
    from _pytest.warning_types import PytestWarning
    xml = getattr(request.config, '_xml', None)
    if xml is not None and xml.family not in ('xunit1', 'legacy'):
        request.node.warn(PytestWarning(
            "{fixture_name} is incompatible with junit_family '{family}' (use 'legacy' or 'xunit1')"
            .format(fixture_name=fixture_name, family=xml.family)))
