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

@@ -4,6 +4,7 @@ from __future__ import division
from __future__ import print_function
import sys
from unittest import mock
from six import text_type
from test_excinfo import TWMock
@@ -11,11 +12,6 @@ from test_excinfo import TWMock
import _pytest._code
import pytest
try:
import mock
except ImportError:
import unittest.mock as mock
def test_ne():
code1 = _pytest._code.Code(compile('foo = "bar"', "", "exec"))
@@ -92,21 +88,6 @@ def test_unicode_handling():
excinfo = pytest.raises(Exception, f)
text_type(excinfo)
if sys.version_info < (3,):
bytes(excinfo)
@pytest.mark.skipif(sys.version_info[0] >= 3, reason="python 2 only issue")
def test_unicode_handling_syntax_error():
value = u"ąć".encode("UTF-8")
def f():
raise SyntaxError("invalid syntax", (None, 1, 3, value))
excinfo = pytest.raises(Exception, f)
str(excinfo)
if sys.version_info[0] < 3:
text_type(excinfo)
def test_code_getargs():
@@ -202,10 +183,8 @@ class TestReprFuncArgs(object):
r = ReprFuncArgs(args)
r.toterminal(tw)
if sys.version_info[0] >= 3:
assert (
tw.lines[0]
== r"unicode_string = São Paulo, utf8_string = b'S\xc3\xa3o Paulo'"
)
else:
assert tw.lines[0] == "unicode_string = São Paulo, utf8_string = São Paulo"
assert (
tw.lines[0]
== r"unicode_string = São Paulo, utf8_string = b'S\xc3\xa3o Paulo'"
)