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

@@ -459,9 +459,6 @@ class TestTrialUnittest(object):
pass
"""
)
from _pytest.compat import _is_unittest_unexpected_success_a_failure
should_fail = _is_unittest_unexpected_success_a_failure()
result = testdir.runpytest("-rxs", *self.ignore_unclosed_socket_warning)
result.stdout.fnmatch_lines_random(
[
@@ -472,12 +469,10 @@ class TestTrialUnittest(object):
"*i2wanto*",
"*sys.version_info*",
"*skip_in_method*",
"*1 failed*4 skipped*3 xfailed*"
if should_fail
else "*4 skipped*3 xfail*1 xpass*",
"*1 failed*4 skipped*3 xfailed*",
]
)
assert result.ret == (1 if should_fail else 0)
assert result.ret == 1
def test_trial_error(self, testdir):
testdir.makepyfile(
@@ -745,22 +740,17 @@ def test_unittest_expected_failure_for_passing_test_is_fail(testdir, runner):
unittest.main()
"""
)
from _pytest.compat import _is_unittest_unexpected_success_a_failure
should_fail = _is_unittest_unexpected_success_a_failure()
if runner == "pytest":
result = testdir.runpytest("-rxX")
result.stdout.fnmatch_lines(
[
"*MyTestCase*test_passing_test_is_fail*",
"*1 failed*" if should_fail else "*1 xpassed*",
]
["*MyTestCase*test_passing_test_is_fail*", "*1 failed*"]
)
else:
result = testdir.runpython(script)
result.stderr.fnmatch_lines(["*1 test in*", "*(unexpected successes=1)*"])
assert result.ret == (1 if should_fail else 0)
assert result.ret == 1
@pytest.mark.parametrize(