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:
@@ -5,6 +5,9 @@ import math
|
||||
import pprint
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import Iterable
|
||||
from collections.abc import Mapping
|
||||
from collections.abc import Sized
|
||||
from decimal import Decimal
|
||||
from numbers import Number
|
||||
|
||||
@@ -15,9 +18,6 @@ from six.moves import zip
|
||||
import _pytest._code
|
||||
from _pytest import deprecated
|
||||
from _pytest.compat import isclass
|
||||
from _pytest.compat import Iterable
|
||||
from _pytest.compat import Mapping
|
||||
from _pytest.compat import Sized
|
||||
from _pytest.compat import STRING_TYPES
|
||||
from _pytest.outcomes import fail
|
||||
|
||||
@@ -81,9 +81,6 @@ class ApproxBase(object):
|
||||
def __ne__(self, actual):
|
||||
return not (actual == self)
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
__cmp__ = _cmp_raises_type_error
|
||||
|
||||
def _approx_scalar(self, x):
|
||||
return ApproxScalar(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok)
|
||||
|
||||
@@ -122,9 +119,6 @@ class ApproxNumpy(ApproxBase):
|
||||
list_scalars = _recursive_list_map(self._approx_scalar, self.expected.tolist())
|
||||
return "approx({!r})".format(list_scalars)
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
__cmp__ = _cmp_raises_type_error
|
||||
|
||||
def __eq__(self, actual):
|
||||
import numpy as np
|
||||
|
||||
@@ -251,10 +245,7 @@ class ApproxScalar(ApproxBase):
|
||||
except ValueError:
|
||||
vetted_tolerance = "???"
|
||||
|
||||
if sys.version_info[0] == 2:
|
||||
return "{} +- {}".format(self.expected, vetted_tolerance)
|
||||
else:
|
||||
return u"{} \u00b1 {}".format(self.expected, vetted_tolerance)
|
||||
return "{} \u00b1 {}".format(self.expected, vetted_tolerance)
|
||||
|
||||
def __eq__(self, actual):
|
||||
"""
|
||||
@@ -736,8 +727,6 @@ class RaisesContext(object):
|
||||
fail(self.message)
|
||||
self.excinfo.__init__(tp)
|
||||
suppress_exception = issubclass(self.excinfo.type, self.expected_exception)
|
||||
if sys.version_info[0] == 2 and suppress_exception:
|
||||
sys.exc_clear()
|
||||
if self.match_expr is not None and suppress_exception:
|
||||
self.excinfo.match(self.match_expr)
|
||||
return suppress_exception
|
||||
|
||||
Reference in New Issue
Block a user