Skip to content

Commit 6e1b1ab

Browse files
committed
Remove deprecated record_xml_property
Fix pytest-dev#4547
1 parent ae5d5b8 commit 6e1b1ab

File tree

4 files changed

+25
-38
lines changed

4 files changed

+25
-38
lines changed

changelog/4547.removal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The deprecated ``record_xml_property`` fixture has been removed, use the more generic ``record_property`` instead.
2+
3+
See our `docs <https://docs.pytest.org/en/latest/deprecations.html#record-xml-property>`__ for more information.

doc/en/deprecations.rst

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -149,28 +149,6 @@ As part of a large :ref:`marker-revamp`, :meth:`_pytest.nodes.Node.get_marker` i
149149
:ref:`the documentation <update marker code>` on tips on how to update your code.
150150

151151

152-
record_xml_property
153-
~~~~~~~~~~~~~~~~~~~
154-
155-
.. deprecated:: 3.5
156-
157-
The ``record_xml_property`` fixture is now deprecated in favor of the more generic ``record_property``, which
158-
can be used by other consumers (for example ``pytest-html``) to obtain custom information about the test run.
159-
160-
This is just a matter of renaming the fixture as the API is the same:
161-
162-
.. code-block:: python
163-
164-
def test_foo(record_xml_property):
165-
...
166-
167-
Change to:
168-
169-
.. code-block:: python
170-
171-
def test_foo(record_property):
172-
...
173-
174152
pytest_plugins in non-top-level conftest files
175153
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176154

@@ -353,6 +331,28 @@ more information.
353331

354332
This has been documented as deprecated for years, but only now we are actually emitting deprecation warnings.
355333

334+
record_xml_property
335+
~~~~~~~~~~~~~~~~~~~
336+
337+
*Removed in version 4.0.*
338+
339+
The ``record_xml_property`` fixture is now deprecated in favor of the more generic ``record_property``, which
340+
can be used by other consumers (for example ``pytest-html``) to obtain custom information about the test run.
341+
342+
This is just a matter of renaming the fixture as the API is the same:
343+
344+
.. code-block:: python
345+
346+
def test_foo(record_xml_property):
347+
...
348+
349+
Change to:
350+
351+
.. code-block:: python
352+
353+
def test_foo(record_property):
354+
...
355+
356356
``yield`` tests
357357
~~~~~~~~~~~~~~~
358358

src/_pytest/deprecated.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@
8282
"See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec"
8383
)
8484

85-
RECORD_XML_PROPERTY = RemovedInPytest4Warning(
86-
'Fixture renamed from "record_xml_property" to "record_property" as user '
87-
"properties are now available to all reporters.\n"
88-
'"record_xml_property" is now deprecated.'
89-
)
90-
9185

9286
PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST = RemovedInPytest4Warning(
9387
"Defining pytest_plugins in a non-top-level conftest is deprecated, "

src/_pytest/junitxml.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -263,16 +263,6 @@ def append_property(name, value):
263263
return append_property
264264

265265

266-
@pytest.fixture
267-
def record_xml_property(record_property, request):
268-
"""(Deprecated) use record_property."""
269-
from _pytest import deprecated
270-
271-
request.node.warn(deprecated.RECORD_XML_PROPERTY)
272-
273-
return record_property
274-
275-
276266
@pytest.fixture
277267
def record_xml_attribute(request):
278268
"""Add extra xml attributes to the tag for the calling test.

0 commit comments

Comments
 (0)