Drop Python 2.7 and 3.4 support

* Update setup.py requires and classifiers
* Drop Python 2.7 and 3.4 from CI
* Update docs dropping 2.7 and 3.4 support
* Fix mock imports and remove tests related to pypi's mock module
* Add py27 and 34 support docs to the sidebar
* Remove usage of six from tmpdir
* Remove six.PY* code blocks
* Remove sys.version_info related code
* Cleanup compat
* Remove obsolete safe_str
* Remove obsolete __unicode__ methods
* Remove compat.PY35 and compat.PY36: not really needed anymore
* Remove unused UNICODE_TYPES
* Remove Jython specific code
* Remove some Python 2 references from docs

Related to #5275
This commit is contained in:
Bruno Oliveira
2019-05-27 20:31:52 -03:00
parent 733f43b02e
commit 4d49ba6529
64 changed files with 226 additions and 1331 deletions

View File

@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import doctest
import operator
import sys
from decimal import Decimal
from fractions import Fraction
from operator import eq
@@ -28,7 +27,7 @@ class MyDocTestRunner(doctest.DocTestRunner):
class TestApprox(object):
@pytest.fixture
def plus_minus(self):
return u"\u00b1" if sys.version_info[0] > 2 else u"+-"
return u"\u00b1"
def test_repr_string(self, plus_minus):
tol1, tol2, infr = "1.0e-06", "2.0e-06", "inf"

View File

@@ -679,8 +679,6 @@ class TestSorting(object):
assert fn1 == fn2
assert fn1 != modcol
if sys.version_info < (3, 0):
assert cmp(fn1, fn2) == 0 # NOQA
assert hash(fn1) == hash(fn2)
fn3 = testdir.collect_by_name(modcol, "test_fail")

View File

@@ -13,8 +13,6 @@ from _pytest import fixtures
from _pytest import python
from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG
PY3 = sys.version_info >= (3, 0)
class TestMetafunc(object):
def Metafunc(self, func, config=None):

View File

@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
import sys
import six
import pytest
from _pytest.outcomes import Failed
from _pytest.warning_types import PytestDeprecationWarning
@@ -265,16 +263,7 @@ class TestRaises(object):
def __class__(self):
assert False, "via __class__"
if six.PY2:
with pytest.raises(pytest.fail.Exception) as excinfo:
with pytest.raises(CrappyClass()):
pass
assert "DID NOT RAISE" in excinfo.value.args[0]
with pytest.raises(CrappyClass) as excinfo:
raise CrappyClass()
else:
with pytest.raises(AssertionError) as excinfo:
with pytest.raises(CrappyClass()):
pass
assert "via __class__" in excinfo.value.args[0]
with pytest.raises(AssertionError) as excinfo:
with pytest.raises(CrappyClass()):
pass
assert "via __class__" in excinfo.value.args[0]