From b05061dcd27516da907ce62964263fd91f006ade Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 22 Nov 2018 21:14:53 -0200 Subject: [PATCH] Change deprecation type of --result-log to PytestDeprecationWarning It was decided to deprecate this on a later date (see discussion in #4447) --- changelog/4447.trivial.rst | 3 +++ doc/en/deprecations.rst | 4 ++++ doc/en/usage.rst | 10 +++------- src/_pytest/deprecated.py | 6 +++--- testing/deprecated_test.py | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 changelog/4447.trivial.rst diff --git a/changelog/4447.trivial.rst b/changelog/4447.trivial.rst new file mode 100644 index 000000000..884ccd4c9 --- /dev/null +++ b/changelog/4447.trivial.rst @@ -0,0 +1,3 @@ +Changed the deprecation type of ``--result-log`` to ``PytestDeprecationWarning``. + +It was decided to remove this feature at the next major revision. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 229bca171..dbcb55271 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -303,6 +303,10 @@ Result log (``--result-log``) The ``--resultlog`` command line option has been deprecated: it is little used and there are more modern and better alternatives, for example `pytest-tap `_. +This feature will be effectively removed in pytest 4.0 as the team intends to include a better alternative in the core. + +If you have any concerns, please don't hesitate to `open an issue `__. + Removed Features ---------------- diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 6c42cd0ec..49c2aa577 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -483,14 +483,10 @@ Creating resultlog format files .. deprecated:: 3.0 - This option is rarely used and is scheduled for removal in 4.0. + This option is rarely used and is scheduled for removal in 5.0. - An alternative for users which still need similar functionality is to use the - `pytest-tap `_ plugin which provides - a stream of test data. - - If you have any concerns, please don't hesitate to - `open an issue `_. + See `the deprecation docs `__ + for more information. To create plain-text machine-readable result files you can issue:: diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index ba7426a11..23b32c3e0 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -56,9 +56,9 @@ GETFUNCARGVALUE = RemovedInPytest4Warning( "getfuncargvalue is deprecated, use getfixturevalue" ) -RESULT_LOG = RemovedInPytest4Warning( - "--result-log is deprecated and scheduled for removal in pytest 4.0.\n" - "See https://docs.pytest.org/en/latest/usage.html#creating-resultlog-format-files for more information." +RESULT_LOG = PytestDeprecationWarning( + "--result-log is deprecated and scheduled for removal in pytest 5.0.\n" + "See https://docs.pytest.org/en/latest/deprecations.html#result-log-result-log for more information." ) MARK_INFO_ATTRIBUTE = RemovedInPytest4Warning( diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index bc2e8378b..8638da05a 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -120,8 +120,8 @@ def test_resultlog_is_deprecated(testdir): result = testdir.runpytest("--result-log=%s" % testdir.tmpdir.join("result.log")) result.stdout.fnmatch_lines( [ - "*--result-log is deprecated and scheduled for removal in pytest 4.0*", - "*See https://docs.pytest.org/en/latest/usage.html#creating-resultlog-format-files for more information*", + "*--result-log is deprecated and scheduled for removal in pytest 5.0*", + "*See https://docs.pytest.org/en/latest/deprecations.html#result-log-result-log for more information*", ] )