Skip to content

Commit 3288c9a

Browse files
committed
Improve user guidance regarding --resultlog deprecation
Fix #2739
1 parent 539523c commit 3288c9a

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

_pytest/deprecated.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ class RemovedInPytest4Warning(DeprecationWarning):
2626

2727
GETFUNCARGVALUE = "use of getfuncargvalue is deprecated, use getfixturevalue"
2828

29-
RESULT_LOG = '--result-log is deprecated and scheduled for removal in pytest 4.0'
29+
RESULT_LOG = (
30+
'--result-log is deprecated and scheduled for removal in pytest 4.0.\n'
31+
'See https://docs.pytest.org/en/latest/usage.html#creating-resultlog-format-files for more information.'
32+
)
3033

3134
MARK_INFO_ATTRIBUTE = RemovedInPytest4Warning(
3235
"MarkInfo objects are deprecated as they contain the merged marks"

changelog/2739.trivial

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve user guidance regarding ``--resultlog`` deprecation.

doc/en/usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,13 @@ Creating resultlog format files
311311

312312
This option is rarely used and is scheduled for removal in 4.0.
313313

314+
An alternative for users which still need similar functionality is to use the
315+
`pytest-tap <https://pypi.python.org/pypi/pytest-tap>`_ plugin which provides
316+
a stream of test data.
317+
318+
If you have any concerns, please don't hesitate to
319+
`open an issue <https://github.com/pytest-dev/pytest/issues>`_.
320+
314321
To create plain-text machine-readable result files you can issue::
315322

316323
pytest --resultlog=path

testing/deprecated_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,7 @@ def test():
7878
pass
7979
''')
8080
result = testdir.runpytest('--result-log=%s' % testdir.tmpdir.join('result.log'))
81-
result.stdout.fnmatch_lines(['*--result-log is deprecated and scheduled for removal in pytest 4.0*'])
81+
result.stdout.fnmatch_lines([
82+
'*--result-log is deprecated and scheduled for removal in pytest 4.0*',
83+
'*See https://docs.pytest.org/*/usage.html#creating-resultlog-format-files for more information*',
84+
])

0 commit comments

Comments
 (0)