From 3288c9a110558b703a89896a5e3f08ff58dfa732 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 31 Aug 2017 19:11:20 -0300 Subject: [PATCH] Improve user guidance regarding ``--resultlog`` deprecation Fix #2739 --- _pytest/deprecated.py | 5 ++++- changelog/2739.trivial | 1 + doc/en/usage.rst | 7 +++++++ testing/deprecated_test.py | 5 ++++- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 changelog/2739.trivial diff --git a/_pytest/deprecated.py b/_pytest/deprecated.py index 4f7b9e936..38e949677 100644 --- a/_pytest/deprecated.py +++ b/_pytest/deprecated.py @@ -26,7 +26,10 @@ SETUP_CFG_PYTEST = '[pytest] section in setup.cfg files is deprecated, use [tool GETFUNCARGVALUE = "use of getfuncargvalue is deprecated, use getfixturevalue" -RESULT_LOG = '--result-log is deprecated and scheduled for removal in pytest 4.0' +RESULT_LOG = ( + '--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.' +) MARK_INFO_ATTRIBUTE = RemovedInPytest4Warning( "MarkInfo objects are deprecated as they contain the merged marks" diff --git a/changelog/2739.trivial b/changelog/2739.trivial new file mode 100644 index 000000000..861f4d341 --- /dev/null +++ b/changelog/2739.trivial @@ -0,0 +1 @@ +Improve user guidance regarding ``--resultlog`` deprecation. diff --git a/doc/en/usage.rst b/doc/en/usage.rst index 9360a8ed2..a8c6d40a0 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -311,6 +311,13 @@ Creating resultlog format files This option is rarely used and is scheduled for removal in 4.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 `_. + To create plain-text machine-readable result files you can issue:: pytest --resultlog=path diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index a59ad128b..3f244a53c 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -78,4 +78,7 @@ def test_resultlog_is_deprecated(testdir): pass ''') 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*']) + result.stdout.fnmatch_lines([ + '*--result-log is deprecated and scheduled for removal in pytest 4.0*', + '*See https://docs.pytest.org/*/usage.html#creating-resultlog-format-files for more information*', + ])