aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest/py3/_pytest/junitxml.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2025-05-05 12:31:52 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2025-05-05 12:41:33 +0300
commit6ff49ec58061f642c3a2f83c61eba12820787dfc (patch)
treec733ec9bdb15ed280080d31dea8725bfec717acd /contrib/python/pytest/py3/_pytest/junitxml.py
parenteefca8305c6a545cc6b16dca3eb0d91dcef2adcd (diff)
downloadydb-6ff49ec58061f642c3a2f83c61eba12820787dfc.tar.gz
Intermediate changes
commit_hash:8b3bb826b17db8329ed1221f545c0645f12c552d
Diffstat (limited to 'contrib/python/pytest/py3/_pytest/junitxml.py')
-rw-r--r--contrib/python/pytest/py3/_pytest/junitxml.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/python/pytest/py3/_pytest/junitxml.py b/contrib/python/pytest/py3/_pytest/junitxml.py
index 9ee35b84e84..9009ec7aa0a 100644
--- a/contrib/python/pytest/py3/_pytest/junitxml.py
+++ b/contrib/python/pytest/py3/_pytest/junitxml.py
@@ -6,12 +6,12 @@ Based on initial code from Ross Lawley.
Output conforms to
https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
"""
+
+from datetime import datetime
import functools
import os
import platform
import re
-import xml.etree.ElementTree as ET
-from datetime import datetime
from typing import Callable
from typing import Dict
from typing import List
@@ -19,8 +19,8 @@ from typing import Match
from typing import Optional
from typing import Tuple
from typing import Union
+import xml.etree.ElementTree as ET
-import pytest
from _pytest import nodes
from _pytest import timing
from _pytest._code.code import ExceptionRepr
@@ -32,6 +32,7 @@ from _pytest.fixtures import FixtureRequest
from _pytest.reports import TestReport
from _pytest.stash import StashKey
from _pytest.terminal import TerminalReporter
+import pytest
xml_key = StashKey["LogXML"]()
@@ -248,7 +249,9 @@ class _NodeReporter:
skipreason = skipreason[9:]
details = f"{filename}:{lineno}: {skipreason}"
- skipped = ET.Element("skipped", type="pytest.skip", message=skipreason)
+ skipped = ET.Element(
+ "skipped", type="pytest.skip", message=bin_xml_escape(skipreason)
+ )
skipped.text = bin_xml_escape(details)
self.append(skipped)
self.write_captured_output(report)
@@ -271,9 +274,7 @@ def _warn_incompatibility_with_xunit2(
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
- )
+ f"{fixture_name} is incompatible with junit_family '{xml.family}' (use 'legacy' or 'xunit1')"
)
)
@@ -365,7 +366,6 @@ def record_testsuite_property(request: FixtureRequest) -> Callable[[str, object]
`pytest-xdist <https://github.com/pytest-dev/pytest-xdist>`__ plugin. See
:issue:`7767` for details.
"""
-
__tracebackhide__ = True
def record_func(name: str, value: object) -> None: