Skip to content
Permalink
Browse files

Merge pull request #3529 from asottile/unpy25

Remove some python2.5 compatibility code
  • Loading branch information...
RonnyPfannschmidt committed Jun 4, 2018
2 parents d609b63 + 2f6555d commit a7f9e8382bf0027276233a81aa0c6f9100a23c41
Showing with 7 additions and 8 deletions.
  1. +1 −0 changelog/3629.trivial.rst
  2. +1 −1 src/_pytest/compat.py
  3. +1 −2 src/_pytest/fixtures.py
  4. +1 −2 testing/code/test_excinfo.py
  5. +3 −3 testing/test_assertion.py
@@ -0,0 +1 @@
Remove some python2.5 compatibility code.
@@ -83,7 +83,7 @@ def iscoroutinefunction(func):

def getlocation(function, curdir):
fn = py.path.local(inspect.getfile(function))
lineno = py.builtin._getcode(function).co_firstlineno
lineno = function.__code__.co_firstlineno
if fn.relto(curdir):
fn = fn.relto(curdir)
return "%s:%d" % (fn, lineno + 1)
@@ -354,8 +354,7 @@ def instance(self):
return self._pyfuncitem._testcase
except AttributeError:
function = getattr(self, "function", None)
if function is not None:
return py.builtin._getimself(function)
return getattr(function, "__self__", None)

@scopeproperty()
def module(self):
@@ -13,6 +13,7 @@
ReprExceptionInfo,
ExceptionChainRepr,
)
from six.moves import queue

from test_source import astonly

@@ -23,8 +24,6 @@
else:
invalidate_import_caches = getattr(importlib, "invalidate_caches", None)

queue = py.builtin._tryimport("queue", "Queue")

failsonjython = pytest.mark.xfail("sys.platform.startswith('java')")

pytest_version_info = tuple(map(int, pytest.__version__.split(".")[:3]))
@@ -546,9 +546,9 @@ def test_mojibake(self):
# issue 429
left = "e"
right = "\xc3\xa9"
if not isinstance(left, py.builtin.bytes):
left = py.builtin.bytes(left, "utf-8")
right = py.builtin.bytes(right, "utf-8")
if not isinstance(left, bytes):
left = bytes(left, "utf-8")
right = bytes(right, "utf-8")
expl = callequal(left, right)
for line in expl:
assert isinstance(line, py.builtin.text)

0 comments on commit a7f9e83

Please sign in to comment.
You can’t perform that action at this time.