Improve user guidance regarding ``--resultlog`` deprecation

Fix #2739
This commit is contained in:
Bruno Oliveira 2017-08-31 19:11:20 -03:00
parent 539523cfee
commit 3288c9a110
4 changed files with 16 additions and 2 deletions

View File

@ -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" 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( MARK_INFO_ATTRIBUTE = RemovedInPytest4Warning(
"MarkInfo objects are deprecated as they contain the merged marks" "MarkInfo objects are deprecated as they contain the merged marks"

1
changelog/2739.trivial Normal file
View File

@ -0,0 +1 @@
Improve user guidance regarding ``--resultlog`` deprecation.

View File

@ -311,6 +311,13 @@ Creating resultlog format files
This option is rarely used and is scheduled for removal in 4.0. 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 <https://pypi.python.org/pypi/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>`_.
To create plain-text machine-readable result files you can issue:: To create plain-text machine-readable result files you can issue::
pytest --resultlog=path pytest --resultlog=path

View File

@ -78,4 +78,7 @@ def test_resultlog_is_deprecated(testdir):
pass pass
''') ''')
result = testdir.runpytest('--result-log=%s' % testdir.tmpdir.join('result.log')) 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*',
])