Merge pull request #4773 from nicoddemus/remove-py27-py34-deprecation-warning

Remove py27 py34 deprecation warning
This commit is contained in:
Anthony Sottile 2019-02-12 21:42:07 -05:00 committed by GitHub
commit f672b7e39e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 37 deletions

View File

@ -0,0 +1,5 @@
The warning about Python 2.7 and 3.4 not being supported in pytest 5.0 has been removed.
In the end it was considered to be more
of a nuisance than actual utility and users of those Python versions shouldn't have problems as ``pip`` will not
install pytest 5.0 on those interpreters.

View File

@ -653,7 +653,6 @@ class TerminalReporter(object):
self.summary_passes() self.summary_passes()
# Display any extra warnings from teardown here (if any). # Display any extra warnings from teardown here (if any).
self.summary_warnings() self.summary_warnings()
self.summary_deprecated_python()
def pytest_keyboard_interrupt(self, excinfo): def pytest_keyboard_interrupt(self, excinfo):
self._keyboardinterrupt_memo = excinfo.getrepr(funcargs=True) self._keyboardinterrupt_memo = excinfo.getrepr(funcargs=True)
@ -775,20 +774,6 @@ class TerminalReporter(object):
self.write_sep("_", msg) self.write_sep("_", msg)
self._outrep_summary(rep) self._outrep_summary(rep)
def summary_deprecated_python(self):
if sys.version_info[:2] <= (3, 4) and self.verbosity >= 0:
self.write_sep("=", "deprecated python version", yellow=True, bold=False)
using_version = ".".join(str(x) for x in sys.version_info[:3])
self.line(
"You are using Python {}, which will no longer be supported in pytest 5.0".format(
using_version
),
yellow=True,
bold=False,
)
self.line("For more information, please read:")
self.line(" https://docs.pytest.org/en/latest/py27-py34-deprecation.html")
def print_teardown_sections(self, rep): def print_teardown_sections(self, rep):
showcapture = self.config.option.showcapture showcapture = self.config.option.showcapture
if showcapture == "no": if showcapture == "no":

View File

@ -854,9 +854,7 @@ class TestDurations(object):
result = testdir.runpytest("--durations=2") result = testdir.runpytest("--durations=2")
assert result.ret == 0 assert result.ret == 0
lines = result.stdout.get_lines_after("*slowest*durations*") lines = result.stdout.get_lines_after("*slowest*durations*")
# account for the "deprecated python version" header assert "4 passed" in lines[2]
index = 2 if sys.version_info[:2] > (3, 4) else 6
assert "4 passed" in lines[index]
def test_calls_showall(self, testdir): def test_calls_showall(self, testdir):
testdir.makepyfile(self.source) testdir.makepyfile(self.source)

View File

@ -3,7 +3,6 @@ from __future__ import division
from __future__ import print_function from __future__ import print_function
import os import os
import sys
import pytest import pytest
from _pytest.warning_types import PytestDeprecationWarning from _pytest.warning_types import PytestDeprecationWarning
@ -223,24 +222,6 @@ def test_fixture_named_request(testdir):
) )
def test_python_deprecation(testdir):
result = testdir.runpytest()
python_ver = ".".join(str(x) for x in sys.version_info[:3])
msg = "You are using Python {}, which will no longer be supported in pytest 5.0".format(
python_ver
)
if sys.version_info[:2] <= (3, 4):
result.stdout.fnmatch_lines(
[
msg,
"For more information, please read:",
" https://docs.pytest.org/en/latest/py27-py34-deprecation.html",
]
)
else:
assert msg not in result.stdout.str()
def test_pytest_warns_unknown_kwargs(): def test_pytest_warns_unknown_kwargs():
with pytest.warns( with pytest.warns(
PytestDeprecationWarning, PytestDeprecationWarning,