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

Function _warn_incompatibility_with_xunit2

src/_pytest/junitxml.py:259–271  ·  view source on GitHub ↗

Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions.

(
    request: FixtureRequest, fixture_name: str
)

Source from the content-addressed store, hash-verified

257
258
259def _warn_incompatibility_with_xunit2(
260 request: FixtureRequest, fixture_name: str
261) -> None:
262 """Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions."""
263 from _pytest.warning_types import PytestWarning
264
265 xml = request.config.stash.get(xml_key, None)
266 if xml is not None and xml.family not in ("xunit1", "legacy"):
267 request.node.warn(
268 PytestWarning(
269 f"{fixture_name} is incompatible with junit_family '{xml.family}' (use 'legacy' or 'xunit1')"
270 )
271 )
272
273
274@pytest.fixture

Callers 2

record_propertyFunction · 0.85
record_xml_attributeFunction · 0.85

Calls 3

PytestWarningClass · 0.90
getMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected