diff --git a/_pytest/resultlog.py b/_pytest/resultlog.py index 3670f0214c9..a6275c1afd7 100644 --- a/_pytest/resultlog.py +++ b/_pytest/resultlog.py @@ -9,7 +9,7 @@ def pytest_addoption(parser): group = parser.getgroup("terminal reporting", "resultlog plugin options") group.addoption('--resultlog', '--result-log', action="store", metavar="path", default=None, - help="path for machine-readable result log.") + help="DEPRECATED path for machine-readable result log.") def pytest_configure(config): resultlog = config.option.resultlog @@ -21,6 +21,8 @@ def pytest_configure(config): logfile = open(resultlog, 'w', 1) # line buffered config._resultlog = ResultLog(config, logfile) config.pluginmanager.register(config._resultlog) + config.warn('C1', '--result-log is deprecated and scheduled for ' + 'removal in pytest 4.0') def pytest_unconfigure(config): resultlog = getattr(config, '_resultlog', None) diff --git a/doc/en/usage.rst b/doc/en/usage.rst index d056abd01a1..f87e1496d9e 100644 --- a/doc/en/usage.rst +++ b/doc/en/usage.rst @@ -251,6 +251,10 @@ This will add a property node below the testsuite node to the generated xml: Creating resultlog format files ---------------------------------------------------- +.. deprecated:: 3.0 + + This option is rarely used and is scheduled for removal in 4.0. + 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 edbd5d1cda7..87869bcf265 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -53,3 +53,15 @@ def pytest_logwarning(self, message): def test_getfuncargvalue_is_deprecated(request): pytest.deprecated_call(request.getfuncargvalue, 'tmpdir') + + +def test_resultlog_is_deprecated(testdir): + result = testdir.runpytest('--help') + result.stdout.fnmatch_lines(['*DEPRECATED path for machine-readable result log*']) + + testdir.makepyfile(''' + def test(): + 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*'])