Emit a PytestWarning about the given fixture being incompatible with newer xunit revisions.
(
request: FixtureRequest, fixture_name: str
)
| 257 | |
| 258 | |
| 259 | def _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 |
no test coverage detected