Skip to content

Commit

Permalink
Change deprecation type of --result-log to PytestDeprecationWarning
Browse files Browse the repository at this point in the history
It was decided to deprecate this on a later date (see discussion in #4447)
  • Loading branch information
nicoddemus committed Dec 1, 2018
1 parent 06dc6e3 commit b05061d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions changelog/4447.trivial.rst
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 4 additions & 0 deletions doc/en/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://tappy.readthedocs.io/en/latest/>`_.

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 <https://github.com/pytest-dev/pytest/issues>`__.

Removed Features
----------------

Expand Down
10 changes: 3 additions & 7 deletions doc/en/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pypi.org/project/pytest-tap/>`_ plugin which provides
a stream of test data.

If you have any concerns, please don't hesitate to
`open an issue <https://github.com/pytest-dev/pytest/issues>`_.
See `the deprecation docs <https://docs.pytest.org/en/latest/deprecations.html#result-log-result-log>`__
for more information.

To create plain-text machine-readable result files you can issue::

Expand Down
6 changes: 3 additions & 3 deletions src/_pytest/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"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(
Expand Down
4 changes: 2 additions & 2 deletions testing/deprecated_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def test():
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*",
]
)

Expand Down

0 comments on commit b05061d

Please sign in to comment.