From 6e1b1abfa7ec8816c289df29c5bc8fdfae5e6bff Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 14 Dec 2018 15:10:08 -0200 Subject: [PATCH] Remove deprecated record_xml_property Fix #4547 --- changelog/4547.removal.rst | 3 +++ doc/en/deprecations.rst | 44 +++++++++++++++++++------------------- src/_pytest/deprecated.py | 6 ------ src/_pytest/junitxml.py | 10 --------- 4 files changed, 25 insertions(+), 38 deletions(-) create mode 100644 changelog/4547.removal.rst diff --git a/changelog/4547.removal.rst b/changelog/4547.removal.rst new file mode 100644 index 000000000..a30d5d7bd --- /dev/null +++ b/changelog/4547.removal.rst @@ -0,0 +1,3 @@ +The deprecated ``record_xml_property`` fixture has been removed, use the more generic ``record_property`` instead. + +See our `docs `__ for more information. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 37cffb1fb..d814b0bee 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -149,28 +149,6 @@ As part of a large :ref:`marker-revamp`, :meth:`_pytest.nodes.Node.get_marker` i :ref:`the documentation ` on tips on how to update your code. -record_xml_property -~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 3.5 - -The ``record_xml_property`` fixture is now deprecated in favor of the more generic ``record_property``, which -can be used by other consumers (for example ``pytest-html``) to obtain custom information about the test run. - -This is just a matter of renaming the fixture as the API is the same: - -.. code-block:: python - - def test_foo(record_xml_property): - ... - -Change to: - -.. code-block:: python - - def test_foo(record_property): - ... - pytest_plugins in non-top-level conftest files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -353,6 +331,28 @@ more information. This has been documented as deprecated for years, but only now we are actually emitting deprecation warnings. +record_xml_property +~~~~~~~~~~~~~~~~~~~ + +*Removed in version 4.0.* + +The ``record_xml_property`` fixture is now deprecated in favor of the more generic ``record_property``, which +can be used by other consumers (for example ``pytest-html``) to obtain custom information about the test run. + +This is just a matter of renaming the fixture as the API is the same: + +.. code-block:: python + + def test_foo(record_xml_property): + ... + +Change to: + +.. code-block:: python + + def test_foo(record_property): + ... + ``yield`` tests ~~~~~~~~~~~~~~~ diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 67f0d534f..1de42924d 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -82,12 +82,6 @@ WARNS_EXEC = PytestDeprecationWarning( "See https://docs.pytest.org/en/latest/deprecations.html#raises-warns-exec" ) -RECORD_XML_PROPERTY = RemovedInPytest4Warning( - 'Fixture renamed from "record_xml_property" to "record_property" as user ' - "properties are now available to all reporters.\n" - '"record_xml_property" is now deprecated.' -) - PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST = RemovedInPytest4Warning( "Defining pytest_plugins in a non-top-level conftest is deprecated, " diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 696deb6e9..73adb179c 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -263,16 +263,6 @@ def record_property(request): return append_property -@pytest.fixture -def record_xml_property(record_property, request): - """(Deprecated) use record_property.""" - from _pytest import deprecated - - request.node.warn(deprecated.RECORD_XML_PROPERTY) - - return record_property - - @pytest.fixture def record_xml_attribute(request): """Add extra xml attributes to the tag for the calling test.